[Javascript] two submit buttons in a form ??

Trey H tutwabee at hotmail.com
Thu May 16 17:02:02 CDT 2002


To do this you probably want to make two different forms, one which has 
hidden objects.  When you click one button it will submit the first form.  
When you click the second button, it will take all of the values from the 
first form and move them to the second.  It will then submit the second 
form.  The code is in the attached file.  Here is also a copy of the code:
<form name=frm1>
<textarea name=obj1></textarea>
<br>
Select Box:
<select name=obj2>
<option value=1>Option 1</option>
<option value=2>Option 2</option>
<option value=3>Option 3</option>
<option value=4>Option 4</option>
</select>
<br>
<input type=submit value="Check In">
<input type=button value="Check Out" onClick="checkOut()">
</form>
<form name=frm2>
<input type=hidden name=obj1>
<input type=hidden name=obj2>
</form>
<script>
<!--
function checkOut() {
document.frm2.obj1.value=document.frm1.obj1.value;
document.frm2.obj2.value=document.frm1.obj2.value;
document.frm2.submit();
}
//  -->
</script>

====================================
Trey: tutwabee at hotmail.com
Get free JavaScripts at the Blue Dragon!
Just go to:
http://www.websiter.biz
====================================
Make money by being online:
http://www.degoo.com/index.php?refid=tutwabee
===================================
Earn free traffic for your website easily:
http://tools.addme.com/servlet/popview?id=52260
====================================


>From: "Dijam majiD" <yna54 at hotmail.com>
>Reply-To: javascript at LaTech.edu
>To: javascript at LaTech.edu
>Subject: [Javascript] two submit buttons in a form ??
>Date: Thu, 16 May 2002 18:45:33 +0000
>
>
>Hi,
>
>I have a form in a jsp file that has :
>
>1)Drop down list (for names)
>2)textarea  ( for comment)
>
>
>I want to have two submit buttons (chekin, checkout), who to do it please ?
>thanks
>
>
>
>_________________________________________________________________
>Chat with friends online, try MSN Messenger: http://messenger.msn.com
>
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript






_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: form.html
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20020516/fc84282f/attachment.txt>


More information about the Javascript mailing list