Watch Our YouTube Channel
It is currently Sat Dec 16, 2017 5:18 am

All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Wed Jun 19, 2013 12:51 pm 

Joined: Tue Jan 29, 2013 10:24 am
Posts: 145
Location: India
If we have only one Submit Button it will easy to Validate the Form.But while we have more submit Button use the below code.
<title>Form Validation for More Submit Button</title>
<script type="text/javascript">
function submitForm(target)
        alert("Text box should contains some value");
        return false;
    if (target == 0){ document.form.action="http://TheQuotes.Net"; document.form.submit();}
    if (target == 1){ document.form.action="";  document.form.submit();}
<form action="" method="POST" id="form" name="form">
<input type="text" name="textbox" id="textbox" value=""/>
<input align="middle" type="submit" value="Quotes" name="Submit" id="button" onClick="return submitForm(0)"/>
<input align="middle" type="submit" value="Blog" name="Submit" id="button" onClick="return submitForm(1)"/>

K.Suresh Kumar
Motivational Quotes | Web Development | Software Testing

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: