[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

buttons for multiple scripts

Posted on 1997-02-10
1
Medium Priority
?
155 Views
Last Modified: 2013-12-25
i have a bunch of buttons that i want to put on a page and i want each button to call a different script.  i also want the buttons displayed next to each other.  how can i do this?

<form ....action="/cgi-bin/foo.pl">
<input type=submit name="foo button">
</form>
<form ....action="/cgi-bin/bar.pl">
<input type=submit name="bar button">
</form>

is not an option as far as i can tell because i can't have the buttons next to each other.  

possibly javascript?  thanks.

Dan.
0
Comment
Question by:dpaik
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
evilgreg earned 100 total points
ID: 1827624
Nah, don't use Javascript, you'll miss some of your audience. Since you are calling a script, use the power you already have. Make one script, and then have each button have a name. The "Name" attribute in a TYPE="Submit" tag is not used often, but it can be useful in cases like this. So:
<FORM ...action="foo.pl">
<INPUT TYPE="Submit" Name="Ice" Value="Cold!">
<INPUT TYPE="Submit" Name="Ice" Value="Hot!">
</FORM>

Then, in foo.pl:

#!perl etc...split stdin into variables with cgi.pl or the equivalent...stored in %in for this example:

$in{'Ice'} =~ /^Cold/ && &Bar;
$in{'Ice'} =~ /^Hot/ && &Zoo;
## else...
&Zap;

Each sub can call another program if you wish, or even have them open a new page with "Location...". I would keep them all as subroutines within one script myself, branching out to other scripts where necessary. HTH :)
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
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.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

650 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