Skip navigation

Tag Archives: validation


In the form, call onsubmit method
<form method=”post” action=”javascript:alert(‘Submitted’)” onsubmit=”handleSubmit()”>

definition of handleSubmit() function
function handleSubmit() {
var oEvent = EventUtil.getEvent();
oEvent.preventDefault();
// do your validation here

// take reference using any one method
//aForm = document.getElementById(“form1”);
//aForm = document.forms[“form1”];
//aForm = document.forms[0];
aForm = document.form1;

aForm.submit();
}

return false if your validation fails.