The following is my code and I have been trying to make the text fields and submit button to the same level. I do not have a style script with it though:
<table width="200" border="1">
<tbody>
<tr>
<td>
<form action="http://www.aweber.com/scripts/addlead.pl" method="post">
<div style="display: none;">
<input type="hidden" name="meta_web_form_id" value="1557121664" />
<input type="hidden" name="meta_split_id" value="" />
<input type="hidden" name="listname" value="perfumestore" />
<input id="redirect_55278f131e8a7214d84411f07f48b533" type="hidden" name="redirect" value="http://www.aweber.com/thankyou.htm?m=default" />
<input type="hidden" name="meta_adtracking" value="Frontpage" />
<input type="hidden" name="meta_message" value="1" />
<input type="hidden" name="meta_required" value="email" />
<input type="hidden" name="meta_tooltip" value="" />
</div>
<div align="right">
<input id="awf_field-61288568" tabindex="500" type="text" name="email" value="" onFocus=" if (this.value == '') { this.value = ''; }" onBlur="if (this.value == '') { this.value='';} " />
<input type="submit" name="submit" value="Submit"/>
<div>
</div>
</div>
</div>
</form>
you can add inline styles for the div as well as input.
add align="left" or align="right"
you can use Float, padding also.
hope this helps
Related
I am integrating payment gateway in my product. I have to submit a page to third party payment provider. In the page I have asp.button on the click event I want to store the username and amount in the session,When I click the button the page posting to the action url, my click event is not called.
How can I get the value from session and then I want to post the page.
here is the code
Regards
Arun
<form runat="server" method="post" action="https://secure.ogone.com/ncol/test/order.asp" id="form1" name="form1" >
<!-- General information for the order -->
<input type="hidden" name="orderID" value="34567"/>
<input type="hidden" name="pspid" value="TESTMAS"/>
<input type="hidden" name="version" value="ncol_2.0"/>
<input type="hidden" name="language" value="en_US"/>
<input type="hidden" name="currency" value="EUR"/>
<input type="hidden" name="weightunit" value="kg"/>
<input type="hidden" name="accepturl" value="http://localhost:57249/pages/acceptPayment.aspx"/>
<input type="hidden" name="exceptionurl" value="http://localhost:57249/payment/pages/exception.aspx"/>
<input type="hidden" name="declineurl" value="http://localhost:57249/payment/pages/decline.aspx"/>
<input type="hidden" name="cancelurl" value="http://localhost:57249/payment/pages/cancel.aspx"/>
<input type="hidden" name="homeurl" value="http://localhost:57249/payment/updatePayment.aspx"/>
<input type="hidden" name="catalogurl" value="http://localhost:57249/payment/updatePayment.aspx"/>
<input type="hidden" name="SHASign" value="SHA-1"/>
<!-- or Template Page -->
<input type="hidden" name="TP" value="<Your template page URL>"/>
<input type="hidden" name="itemid" value="1" />
<input type="hidden" name="itemname" value="Papercut Balance updation" />
<input type="hidden" name="itemdesc" value="Papercut Balance updation" />
<input type="hidden" name="taxincluded" value="0" />
<input type="hidden" name="itemvatcode" value="1" />
<input type="hidden" name="itemvat" value="" />
<input type="hidden" name="itemcomments" value="Papercut Balance updation" />
<input type="hidden" name="itemquant" value="1" />
<!-- First item of the order -->
<table>
<tr>
<td>username</td>
<td> <asp:TextBox ID="txtusername" Text="" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td>Payable Amount</td>
<td> <asp:TextBox ID="itemprice" Text="" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td colspan="1" >
<asp:Button ID="Button1" runat="server" Text="ProceedToPay" OnClick="Button1_Click" />
</td>
</tr>
</table>
</form>
protected void Button1_Click(object sender, EventArgs e)
{
String userName = Request["txtusername"];
Double amount = Convert.ToDouble(Request["itemprice"]);
try
{
Session["username"] = userName;
Session["amount"] = amount;
}
catch (Exception e2)
{
System.Diagnostics.Debug.WriteLine(e2.Message + " " + e2.Source);
}
}
I have some radio buttons. But I also want to the text clickable. So that the ratio button is selected. So not only if you click on the radio button that the ratio buttion is selected, but also if you click on the text, that the ratio button is selected.
I have this:
<td>
<input id="upload" name="folder" type="radio" value="#item" />
<label>#Html.Label(item)</label>
</td>
Thank you
I try it like this:
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<table>
#foreach (var item in Model.Directories)
{
<tr>
<td>
<input id="upload" name="folder" type="radio" value="#item" />
<label for="upload">#Html.Label(item)</label>
</td>
</tr>
}
</table>
</div>
</div>
I have it now like this:
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<table>
#foreach (var item in Model.Directories)
{
<tr>
<td>
<label>
<input type="radio" name="folder" value="#item" id="upload">
<label for="folder">#Html.Label(item)</label>
</label>
</td>
</tr>
}
</table>
</div>
</div>
but the radio buttons are in a foreach loop, so the id is different of every radio button
I try it like this:
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<table>
#foreach (var item in Model.Directories)
{
#for(var i=0; i < item.Count; i++){
<tr>
<td>
<fieldset>
<input type="radio" name="folder" value="#item" id="folder">
<label for="folder">#Html.Label(item)</label>
</fieldset>
</td>
</tr>
}
}
</table>
</div>
</div>
You can use for attribute with the value of the input's id attribute:
<input id="upload" name="folder" type="radio" value="#item" />
<label for="upload">#Html.Label(item)</label>
the simple way
<td>
<label>
<input id="upload" name="folder" type="radio" value="#item" />
#Html.Label(item)</label>
</td>
use label for
<td>
<input id="upload" name="folder" type="radio" value="#item" />
<label for="upload">#Html.Label(item)</label>
</td>
Using for attribute:
<label for="folder">#Html.Label(item)</label>
You need to enclose the radio within a label tag, To display some text add a tag inside the label:
<label for="upload">
<span>#Html.Label(item)</span>
</label>
<input type="radio" name="folder" value="#item" id="upload" >
I'd like the user to be able to type the amount they wish to pay into a text box, then click "Buy Now", and that amount will be charged through PayPal. How do I go about creating a PayPal button like this?
Success! For anyone else having this problem, here is the code I used:
<form name="input" target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="YOUR BUSINESS NAME">
<input type="hidden" name="item_name" value="ITEM NAME">
<input type="hidden" name="item_number" value="ITEM ID NUMBER">
Other amount: $<input type="text" maxlength="200" style="width:50px;" name="amount" value="5.00"> CAD<br />
<input type="hidden" name="currency_code" value="CAD">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_SM.gif" border="0" alt="PayPal - The safer, easier way to pay online!">
</form>
What I want to happen is when the user chooses the amount they want they click on submit. Now that amount will be passed on to the next page.
The problem is I dont understand the code in the handler, does any know a simple bit of code i can get to make this happen?
Sorry but I am not clear with asp and asp.net
Thanks
<form id='sampleform' method='post' action='handler.asp' >
<p>
Name: <input type='text' name='Name' />
</p>
<p>
Email: <input type='text' name='Email' />
</p>
<input type="radio" name="subject" value="ten" /> £10
<input type="radio" name="subject" value="five" /> £5
<input type="radio" name="subject" value="three" /> £3
£<input type='text' name='donate-amount' />
<p>
<input type='submit' name='Submit' value='Submit' />
</p>
</form>
It would help if I could see the code in handler.asp. Try the following as your handler.asp page
<%=Request.Form("Name")%> <br />
<%=Request.Form("Email")%> <br />
<%=Request.Form("subject")%> <br />
<%=Request.Form("donate-amount")%> <br />
I have implemented a Paypal structure
through my page button it direct to a paypal sandbox,
payment being performed.
form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="abhish_1347270213_biz#gmail.com" />
<input type="hidden" name="item_name" value="Red Jacket" />
<input type="hidden" name="item_number" value="7601" />
<input type="hidden" name="amount" value="125.00" />
<input type="hidden" name="no_shipping" value="2" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="bn" value="PP-BuyNowBF" />
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but23.gif" border="0"
name="submit" alt="Make payments with PayPal - it's fast, free and secure!" />
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1"
height="1" />
<input type="hidden" name="return" value="localhost:53237/WebSite17/Default.aspx" />
<div></div>
</form>
Now when i am trying to redirect to a localhost, its showing an error.
I need to ask is it possible to redirect to a localhost from a paypal, and if it is possible then how shall i implement this. thanks for any assistance.
try http:// in front of the localhost
In place of
<input type="hidden" name="return" value="localhost:53237/WebSite17/Default.aspx" />
place
<input type="hidden" name="return" value="http://localhost:53237/WebSite17/Default.aspx" />
and for IPN notification
place
<input type="hidden" name="notify_url" value="http://localhost:53237/WebSite17/Default.aspx" />
It will redirect to the site with the return Value Varifiedfor the transaction.