Skip navigation

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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: