Submit Two Forms

Results 1 to 3 of 3

Thread: Submit Two Forms

  1. #1
    Blue Angle Guest

    Default Submit Two Forms

    In an asp page, I have two forms with different names.<BR>When i submit one form with javascript statument like form1.submit(), both forms get submited. How to avoid that?<BR><BR>Thanks<BR><BR>ibeliveingod@123india.c om

  2. #2
    Join Date
    Dec 1969

    Default RE: Submit Two Forms

    why two forms? <BR><BR>show your code, you may have a problem with the form tags<BR><BR>j

  3. #3
    Join Date
    Dec 1969

    Default RE: Submit Two Forms

    suppose you have two forms and each has a submit button which generates a javascript script.<BR>you can do the follow :<BR><BR>&#060;form name=form1 action=whatever&#062;<BR>bla bla <BR>&#060;input type=submit onclick="return check()"&#062;<BR><BR>and the same do on the second form<BR>now in the script you write a function of validation or whatever and then, if the form o.k. you write "return true" else "return false".<BR><BR>the "submit" button get the "answer" from the script and up to the answer submit the form or not.<BR><BR>if you want to show and return to the fields which are wrong you can add <BR><BR>document.txt1.focus()--- return to the wrong validate field<BR> --- marking the text <BR><BR>important !!<BR><BR>If you use the "select case" method on your ASP code , give the submit button the same name and different values, but I guess you already know that :-]<BR><BR>hoped I helped!<BR><BR>Amir

Posting Permissions

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