Two submit buttons for a form?

Results 1 to 5 of 5

Thread: Two submit buttons for a form?

  1. #1
    D. R. Guest

    Default Two submit buttons for a form?

    Perhaps the question should be "Can I have two actions for a form?" but here&#039s the problem.<BR><BR>I have a form with several values to be entered. I&#039d like to have two buttons that would pass these values to two different pages and access the values via the request.<BR><BR>To "put some pants" on the project it&#039s a "search criteria" page that needs to go to a "results" page or to an "advanced search criteria" page.

  2. #2
    yahoo Guest

    Default RE: Two submit buttons for a form?

    Definitely u should have to two forms and make it sure on one actions ur form1 name and on another action ur using second form2 name.this should work fine

  3. #3
    D. R. Guest

    Default RE: Two submit buttons for a form?

    If I nest the forms like so:<BR><BR>&#060;FORM action="asp page2.asp" method=POST id=form1 name=form1&#062;<BR> &#060;INPUT type="text" id=text1 name=text1&#062;<BR> &#060;INPUT type="submit" value="Submit" id=submit1 name=submit1&#062;<BR> &#060;form action="asp page3.asp" method=POST id=form2 name=form2&#062;<BR> &#060;INPUT type="submit" value="Submit 2" id=submit2 name=submit2&#062;<BR> &#060;/form&#062; <BR>&#060;/FORM&#062;<BR><BR>Both submit buttons go to "asp page2.asp". If the forms are not nested I can&#039t reference text1 in "asp page3.asp".

  4. #4
    Evert Guest

    Default RE: Two submit buttons for a form?

    Use one form with the action going to the results.asp<BR>Create a submit button and a regular button<BR><BR>On the regular button have a onClick=&#039GoToAdvanceSearch();&#039 event<BR><BR>form is the name of your form.<BR><BR>Create the following Javescript<BR><BR>function GoToAdvanceSearch()<BR>{<BR> form.action = "AdvanceSearch.asp"<BR> form.submit()<BR>}<BR>

  5. #5
    D. R. Guest

    Default Thanks!

    That&#039s the answer! Thanks!

Posting Permissions

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