Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Use two buttons for my form.

Posted on 2006-04-12
2
Medium Priority
?
197 Views
Last Modified: 2010-04-06
I have a web-page with two <select> lists. I would like an extra button for the first <select> that sends data to some other page. It already has a (hidden) submit button as you will see in the code. This is in Perl.

print "<form action=that.pl method=post>"
print "<select size=6 id=a name=sel2 onchange=\"if(this.selectedIndex != -1) submit();\">";
foreach(@ook)
{
print "<option>";
print;
}
print "</select><br>";

#print "<input type=submit id=gv2 value=Go>";
print "</form></td><td align=center>-</td><td>";
print "<form action=this.pl method=post><select name=trig_list size=6>";
foreach(@eek)
{
      print "<option>";
      print;
}
print "</select><br><input type=submit value=\"<<\"></form>";
0
Comment
Question by:n4narik
2 Comments
 
LVL 2

Expert Comment

by:iloya
ID: 16437730
Make it type button and submit the form using script in onclick event of the button
0
 
LVL 1

Accepted Solution

by:
Greydude earned 2000 total points
ID: 16521589
Try this:

<script>
function dosubmit(b)
{
 if (b==1)
 {document.f1.action='this.pl';}
else
 {document.f1.action='that.pl';}
document.f1.submit();
}
Remember to name the form f1.  The link is: javascript:void(dosubmit(1))
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logiā€¦
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question