Re-Opened: Onclick / Onsubmit Radio Buttons | Disable Submit Button On Click
Hey there,
I am new here to this community. I am hoping I am in the right section for posting this question, if I am not I apologize in advance. I recently took over a project and have a question/issue with a form. I have posted on another website (showthread.php?p=1103551#post1103551), but I thought maybe it could be answered here too as if my understanding is correct alot of this coding was made with WebAssist.
Acheivment: When a user clicks on a radio button on our confirm.php page, the form will automaticaly submit and refresh itself without the user have to actually press 'submit' button (which I will hide later). The reason for this is because users are making a radio selection but NOT pressing 'submit' and we are receiving the default or previous selection.
What I have tried: I have tried these coding options, all with the same result. The result is that the page DOES refresh, but the information DOES NOT change or save. The form isn't acutally submitting?
<input <?php if (!(strcmp($_SESSION['shippingmethod'],"1"))) {echo "checked=\"checked\"";} ?> name="grpshipping" type="radio" id="grpshipping_0" value="1" checked="checked" onclick="document.getElementById('Update_shipping').submit()" />
<input <?php if (!(strcmp($_SESSION['shippingmethod'],"2"))) {echo "checked=\"checked\"";} ?> type="radio" name="grpshipping" value="2" id="grpshipping_1" on onChange="this.form.submit();" />
<input <?php if (!(strcmp($_SESSION['shippingmethod'],"3"))) {echo "checked=\"checked\"";} ?> type="radio" name="grpshipping" value="3" id="grpshipping_2" onClick="this.form.action='confirm.php';this.form.submit()" />
Form header:
<form action="" method="post" name="Update_shipping" id="Update_shipping">
Form footer:
<input type="image" name="Update_shipping" id="Update_shipping" value="Update_shipping" alt="Update_shipping" src="WA_eCart/Images/Nautica/Btn4_EN_update.gif" class="eC_ImageButton" />
I think I am on the right track, but I am thinking that something with WebAssist may not prevent things to happen correctly. Maybe not. I have attached the entire php file just in case there is something else incorrect. You can also try the form live by clicking on the link in the begining of the post. There are instructions and information on getting to the live test site and see how its acting.
I appreciate your help, and if can provide anymore information please let me know.