Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

more than one form action on a page, plz help

Status
Not open for further replies.

gavray

Programmer
Jul 17, 2000
65
GB
niggling problem suggestions gratefully received,<br><br>I've got a page which contains two form actions, each pointing to an .asp page.&nbsp;&nbsp;The problem is that when you press submit the form actions get mixed up, the first form action is chosen and the second ignored.&nbsp;&nbsp;In other words does anyone have an idea how to separate them using some code.<br><br>Thanks <br><br>Gav&nbsp;&nbsp;
 
here's the code<br><br>I'd be gratefull if you'd have a look at it for me.<br><br><br>the two actions Musetest2.asp and second.asp get mixed up<br><br><br>&lt;table border=&quot;0&quot; align=&quot;LEFT&quot; height=&quot;500&quot; width=&quot;123&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; bgcolor=&quot;#b3b46c&quot;&gt;<br>&lt;tr&gt;&lt;td WIDTH=&quot;115&quot; HEIGHT=&quot;125&quot; align=&quot;left&quot; valign=&quot;top&quot;&gt;&lt;br&gt;&lt;font face=&quot;aerial&quot; color=&quot;white&quot;&gt;&lt;H5&gt;<br><br><br>&lt;form method=&quot;post&quot; action=&quot;musetest2.asp&quot;&gt;&lt;br&gt;&lt;font face=&quot;aerial&quot; color=&quot;white&quot;&gt;&lt;H5&gt;Search For Song&lt;/font&gt;&lt;br&gt;&lt;input type=&quot;text&quot; name=&quot;NameSong&quot; size=&quot;15&quot;&gt;<br>&lt;input type=&quot;submit&quot; value=&quot;SEARCH&quot;&gt;&lt;/form&gt;&lt;/td&gt;<br>&lt;/tr&gt;<br>&lt;br&gt;&lt;br&gt;&lt;tr&gt;&lt;td&gt;<br>&lt;form method=&quot;post&quot; action=&quot;second.asp&quot;&gt;&lt;br&gt;&lt;font face=&quot;aerial&quot; color=&quot;white&quot;&gt;&lt;H5&gt;Search For Artist&lt;/font&gt;&lt;br&gt;&lt;input type=&quot;text&quot; name=&quot;ArtistName&quot; size=&quot;15&quot;&gt;<br>&lt;input type=&quot;submit&quot; value=&quot;SEARCH&quot;&gt;&lt;/form&gt;&lt;/td&gt;<br>&lt;/tr&gt;<br>&lt;/TABLE&gt;
 
Just Use one form, leave the action blank, then set the action via client side scipting. here is an example.<br><br>&lt;html&gt;<br>&lt;head&gt;<br> &lt;title&gt;TwoActions&lt;/title&gt;<br>&lt;/head&gt;<br><br>&lt;body&gt;<br>&lt;form action=&quot;&quot; name=&quot;frmTwoActions&quot; id=&quot;frmTwoActions&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;Action2&quot;&gt;&lt;/form&gt;<br>&lt;input LANGUAGE=&quot;JavaScript&quot; TYPE=&quot;submit&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VALUE=&quot;Action1&quot; ONCLICK=&quot;AssociateForm.action=&quot;Action1.asp&quot;;frmTwoActions.submit&quot;<br>&lt;input LANGUAGE=&quot;JavaScript&quot; TYPE=&quot;submit&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VALUE=&quot;Action2&quot; ONCLICK=&quot;AssociateForm.action=&quot;Action2.asp&quot;;frmTwoActions.submit&quot;<br>&lt;/Form&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;<br>
 
we have already fix this problem via email, and I have told him to give each form a unique name. which sure enough had worked. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top