How to hide form field while reusing same form - spring-mvc

I am using the following form to save user information.
<%# taglib prefix="sf" uri="http://www.springframework.org/tags/form"%>
<sf:form action="someAction"method="post" commandName="backingBean">
<sf:input type="hidden" name="userId" path="userId" />
<sf:input type="text" placeholder="Username" name="username" path="username" />
<sf:input placeholder="Password" path="password" type="password" name="password" />
<sf:input placeholder="Email" name="email" type="email" path="email" />
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" />
<button type="submit" class="btn btn-default">Submit</button>
</sf:form>
When an user want to edit their information I am sending them the same form using hidden userId. But this time I wish not show password filed in the form. How do I do that.

You could try with an <c:choose><c:when.. that tests a condition and does what you want: "not show password filed in the form"

Related

Wordpress form not sending file attachement to CRM

I may have hit my limit on knowledge on this :-)
I have a wordpress form to integrate with a CRM. When submitted it sends correctly all the data from the form apart from the file attachment. This won't upload.
My code is below... The varchar ID's match the CRM special fields and work fine and so does the re-direct to thank you page.
Am I missing something here to help upload the attachment, or is it an error and just not talking to the CRM's backend?
Many thanks
<form id="HubForm" action="https://www.CRM-DOMAIN-NAME/Api/FormAdd" method="post">
<input type="hidden" name="ClientId" value="123"><input type="hidden" name="FormTypeId" value="123">
<input type="hidden" name="redirect" value="https://www.CLIENTS-DOMAIN-NAME.co.uk/applied/">
<input id="firstname" class="emrform" name="firstname" type="text" placeholder="First Name" required /><br>
<input id="lastname" class="emrform" name="lastname" type="text" placeholder="Last Name" required /><br>
<input id="email" class="emrform" name="varchar3" type="text" placeholder="Phone number" required /><br>
<input id="firstname" class="emrform" name="email" type="text" placeholder="Email" required /><br> Upload your CV<br><input id="fileUpload" class="emrform" name="fileUpload" type="file" accept=".pdf,.doc,.docx" /><br> Interested in receiving further
emails?
<br>
<input type="radio" name="varchar4" value="yes" id="varchar4" checked> YES<br>
<input type="radio" name="varchar4" value="no" id="varchar4"> no<br>
<br>
<br>
<textarea class="emrform" id="textarea" rows="5" name="varchar2" placeholder="Message details..."></textarea>
<br>
<input type="submit" class="emrbtn emrbtn-primary" value="Submit"></form>
<div id="HubFormResult">

Paypal Form Tag issue in asp.net

Hello guys i have gatting issue on loading asp.net
i have using master page for sub pages there is a form tag in materpage i have add a paypal button in sub page which is this in master page form tag is also important
in masterpage <form id="form1" runat="server"></form>
and in sup age
<form id="form2" runat="server" name="Paypal" action="https://www.paypal.com/cgi-bin
/webscr"
method="post">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="upload" value="1" />
<input type="hidden" name="business" value="
<%=System.Web.Configuration.WebConfigurationManager.AppSettings["email"] %>
" />
<input type="hidden" name="item_name_1" value="<%=Session["ItemName"].ToString()%>"
/>
<input type="hidden" name="amount_1" value="<%=Session["ItemCost"].ToString() %>"/>
<input type="hidden" name="quantity_1" value="1" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="return" value="<%=Session["returnUrl"].ToString() %>"/>
<input type="hidden" name="lc" value="Stronger" />
<input type="image" src="images/paynow.png" border="0" name="submit" alt="Make
payments with PayPal - it's fast, free and secure!"
style="background: url(images/update-account.png);"/>
</form>
I'm getting bug this with sub page below
Server Error in '/Project' Application.
A page can have only one server-side Form tag.
Description: An unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: A page can have only one server-side Form tag.
anybody have a idea how can i use form tag in sub page also.
Please check how many <form> tags are written on your aspx/html page. Make sure you are not using masterpage for this page.
Hi I have found this solution and its work solution is below:
<form name="Paypal" action="https://www.paypal.com/cgi-bin/webscr"
method="post" target="_blank"></form>
<form name="Paypal" action="https://www.paypal.com/cgi-bin/webscr"
method="post">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="upload" value="1" />
<input type="hidden" name="business" value="
<%=System.Web.Configuration.WebConfigurationManager.AppSettings["email"] %>
" />
<input type="hidden" name="item_name_1" value="<%=Session["ItemName"].ToString()%>"
/>
<input type="hidden" name="amount_1" value="<%=Session["ItemCost"].ToString() %>"/>
<input type="hidden" name="quantity_1" value="1" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="return" value="<%=Session["returnUrl"].ToString() %>"/>
<input type="hidden" name="lc" value="Stronger" />
<input type="image" src="images/paynow.png" border="0" name="submit" alt="Make
payments with PayPal - it's fast, free and secure!"
style="background: url(images/update-account.png);"/>
</form>
This code is working good as i want.
If you'are under a MasterPage Don't use the form tag as long as you're inside a form, just delete it, delete the hidden input that causes the SUBMIT and, instead, use the following ImageButton:
<asp:ImageButton ID="cmdpay" runat="server" PostBackUrl="https://www.paypal.com/cgi-bin/webscr" Text="" ImageUrl="images/paynow.png" ></asp:ImageButton>
It works

Sending form data to another websites form

I am trying to incorporate a reservation widget within my wordpress install and I have everything working fine except sending the data or it not populating on the other sites form. The site I am trying to send data to is an online reservation software: http://www.directinn.com/demo/
Here is how I am doing my form:
<form name="bookingform" action="http://www.directinn.com/demo" method="get" target="_blank">
<input type="text" name="date1" id="Text1" class="ftxt MyDate three columns" maxlength="10" value="" placeholder="Arrival Date"/>
<input type="text" name="date2" id="Text2" class="ftxt MyDate three columns" maxlength="10" value="" placeholder="Departure Date" />
<input type="submit" name="bookingformsubmit" class="book-now" value="Book Now">
<input type="hidden" name="arrivalDay" value="" />
<input type="hidden" name="arrivalMonth" value="" />
<input type="hidden" name="arrivalYear" value="" />
<input type="hidden" name="departureDay" value="" />
<input type="hidden" name="departureMonth" value="" />
<input type="hidden" name="departureYear" value="" />
<input type="hidden" name="numAdults" value="1" />
Any help would be greatly appreciated ;)
So they are saying if you can iFrame in their Form on your page and if you add the USERNAME for example to the URL, your USERNAME will appear on the invoice. Like this I believe:
http://www.directinn.com/iframefull.html/BOB
I do not think you can make your own form and POST to their page. I see no indication that that is possible from the link you posted of the example.
The code you have will submit a load of Query String data to the receiving site.
The target site may implement some type of cross-site posting prevention which is causing the blockage - or they may ignore your query string parameters entirely.

Paypal Integration Post processing information

I have created a simple button, on a click of it direct it to the paypal site for the payment.
<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="Show" name="item_name" value="My painting" />
<input type="Show" name="amount" value="10.00" />
<input type="submit" value="Buy!" />
</form>
Now what I am trying to do is to redirect to my own page with the transaction successful notification.
I have read websites articles but nothing is providing me with the Solution. Need help regarding to this issue.
Use PayPal Instant Payment Notification (IPN), more information here: https://www.paypal.com/cgi-bin/webscr?cmd=p/pdn/article_pdn_intro-outside.
Here's a code sample:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="alanb#alanb.com">
<input type="hidden" name="undefined_quantity" value="1">
<input type="hidden" name="item_name" value="doodad from alanb.com">
<input type="hidden" name="item_number" value="dd01">
<input type="hidden" name="amount" value="4.99">
<input type="hidden" name="return" value="http://alanb.com/doodads/thanks.html">
<input type="hidden" name="cancel_return" value="http://alanb.com/doodads/canceled.html">
<input type="image" border="0" name="submit" src="http://images.paypal.com/images/x-click-but5.gif" alt="Effectuez vos paiements via PayPal : une solution rapide, gratuite et sécurisée">
</form>
The trick is done by the "return" input element ;).
Another thing that helped me a lot when setting up PayPal Integral Evolution on my website, was this PDF: https://cms.paypal.com/cms_content/FR/en_US/files/developer/IntegralEvolution.pdf. It documents all fields, possible values and how to use them.
Hope this helps,
Carl

Paypal Sandbox integration in asp.net website by using Website Payments Standard

I have integrated paypal sandbox in my asp.net using Website Payments Standard as follow.
<form name="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="abc_131556943_biz#gmail.com" />
<input type="hidden" name="item_name" value="MyItem" />
<input type="hidden" name="amount" value="0.01" />
<input type="hidden" name="return" value="http://stackoverflow.com/questions/ask" />
<input type="hidden" name="cancel_return" value="http://stackoverflow.com" />
<input type="hidden" name="notify_url" value="http://stackoverflow.com" />
<input type="hidden" name="no_shipping" value="1" />
<input type="submit" value="Please Wait....." style="visibility: hidden" />
</form>
Now issue is that when i am redirected to paypal then first it asks to login into paypal sandbox account. I want to ask that is it necessary to login into paypal sandbox for making the payment. Is there any parameter whcih we can send in hidden field so that it does not ask for sandbox login.
Thanks, Rajbir
I usually pre-authenticate into the Sandbox to skip/keep a normal code flow when testing. I don't know of anything that can be done to by pass it other than using a real account.

Resources