Two or more form action

Results 1 to 2 of 2

Thread: Two or more form action

  1. #1
    Rupali Guest

    Default Two or more form action

    Can I have two or more form action and two or more submit buttons in one form.so that for each submit button I can go to that particular form when clicked the respective submit button

  2. #2
    Join Date
    Dec 1969
    Posts
    1,019

    Default RE: Two or more form action

    You need to do a few things to do this:<BR>1. in the form tag, omit the action:<BR>&#060;form method="post" name="myform"&#062;<BR>2. The buttons should pass a value to JavaScript using OnClick:<BR>&#060;input type="button" value="Mail" onClick="JavaScript:doAction(&#039 1&#039)"&#062;<BR>&#060;input type="button" value="Message Board" onClick="JavaScript:doAction(&#039 2&#039)"&#062;<BR>3. In the JavaScript:<BR>function doAction(q) {<BR>if (q=="1") {<BR> document.myform.action="mail.asp"<BR> } else {<BR> document.myform.action="message.asp"<BR>}<BR>docum ent.myform.submit()<BR>}<BR><BR>Enjoy<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •