The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
Hello!
I've built a form, and in the form there are some inputs. So, i've built a little function in JavaScript to validate the value of the fields (in this case a radio button): Code:
function checkShipment()
{
if ((document.shipment.Stype[0].checked) || (document.shipment.Stype[1].checked))
return true;
alert("You didn't Fill The Shipment Information!");
return false;
}
HTML Code:
<input type="submit" value="Checkout" onclick="checkShipment()">
I want to know, how can i stop the browser from proccessing to the next page in case of errors. Thanks! |
|
#2
|
|||
|
|||
|
please someone?
|
|
#3
|
||||
|
||||
|
Use the "onsubmit" property on the form tag and call your function with "return" (ie. onsubmit="return yourcheck(datainput)"). Return false (in your function) to stop submission, true to continue.
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|