Jump to content

1 page, 2 forms, 2 submit buttons, 1 doesn't work


kanala
 Share

Recommended Posts

I have 2 forms on my page, both have submit buttons, but they both seem to submit one form. In other words, when I press submit FORM 1, it submits FORM 2 instead of 1. But FORM 2 works fine, it submits FORM 2. :)

This is FORM 1................................................				  <script type="text/javascript" 				  src="http://images.freewebs.com/JS/formUtils.js"></script>				  <form action="http://members.freewebs.com/formMail.jsp" 					method="post" onsubmit="return validate(this)">					<input type="hidden" name="userid" value="25414241">					<input type="hidden" name="csvFilename" 					value="FWFORBIDDEN-messageboard-output">					<!--1 input(order number)--><label for="04 - Order number:">					Order number:</label> <input disabled class="fw-textarea" 					type="input" id="04 - Order number:" 					name="04 - Order number:" value="0000000000AT" size="20"><script 					type="text/javascript">reqArr[reqArr.length] = "04 - Order number:"					</script> <br>					<br>					<!--2 input(refund/return)-->Select refund or return:<br>					<br>					<input name="05 - Refund/Return:" type="radio" 					value="Refund">Refund<br>					<input name="05 - Refund/Return:" type="radio" 					value="Return">Return<br>					<input type="hidden" name="05 - Refund/Return:" value>					<script type="text/javascript">reqArr[reqArr.length] = "05 - Refund/Return:"					</script>					<br>					<!--3 input(reason)--><label for="06 - Reason:">Reason for refund/return:<br>					</label><br>					<textarea id="06 - Reason:" name="06 - Reason:" rows="8" 					cols="50"></textarea><script type="text/javascript">reqArr[reqArr.length] = "06 - Reason:"					</script>					<!--4 input(next page)--><input type="hidden" name="next" 					value="http://www.takeawaydvds.com/">					<!--5 input(log IP)--><input type="hidden" 					name="logIPAddress" value="1">					<!--6 input(submit)--><center><input type="submit" 					name="07 - Submit Message" value="Submit Message"></center>									  </form>

This is FORM 2................................................				<script type="text/javascript" 				src="http://images.freewebs.com/JS/formUtils.js"></script>				<form action="http://members.freewebs.com/formMail.jsp" 				  method="post" onsubmit="return validate(this)">				  <input type="hidden" name="userid" value="25414241">				  <input type="hidden" name="csvFilename" 				  value="FWFORBIDDEN-messageboard-output">				  <!--1 input(voucher code)--><label for="01 - Voucher code:">Voucher 				  code:</label> <input class="fw-textarea" type="input" 				  id="01 - Voucher code:" name="01 - Voucher code:" value 				  size="20"><script type="text/javascript">reqArr[reqArr.length] = "01 - Voucher code:"				  </script><br>				  <br>				  <!--2 input(voucher from?)-->Where did you get the voucher code 				  from?<br>				  <br>				  <input name="02 - Where from:" type="radio" value="eBay item">eBay 				  item<br>				  <input name="02 - Where from:" type="radio" value="Amazon">Amazon<br>				  <input name="02 - Where from:" type="radio" value="Other">Other 				  (please state)<br>				  <input type="hidden" name="02 - Where from:" value>				  <script type="text/javascript">reqArr[reqArr.length] = "02 - Where from:"				  </script>				  <!--3 input(next page)--><input type="hidden" name="next" 				  value="http://www.takeawaydvds.com/">				  <!--4 input(log IP)--><input type="hidden" 				  name="logIPAddress" value="1">				  <!--5 input(submit)--><center><input type="submit" 				  name="03 - Submit Voucher" value="Submit Voucher"></center>				  <br>				</form>

Link to comment
Share on other sites

The action attribute in both forms are the same, so on submit it goes to that page...FORM1: <form action="http://members.freewebs.com/formMail.jsp" method="post" onsubmit="return validate(this)">FORM2:<form action="http://members.freewebs.com/formMail.jsp" method="post" onsubmit="return validate(this)">
Is there a way of getting round this? Because freewebs only offers one form sending service, maybe directing it somewhere else?
Link to comment
Share on other sites

If you're using a free host, then you're going to be limited. You need a way to tell the form handler what to do with the form, even if you submit several forms to the same form handler. I'm not familiar with the restrictions that freewebs places on their users, so I can't really suggest what to do if you're using them as a host, but the correct way to do this would be to either submit each form to a separate location, or include a hidden form element that will tell the processing page what action to take. Either of these would require that you write the form processor. If freewebs does not let you do that, then you can't do this with freewebs.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...