Hi. I have a CGI script that will need to call itself an unknown
number of times, to add rows, run queries, etc. At the bottom of the
output that is produced by the script, there are four buttons. I need
one of the buttons to simply be a back button. I have this button
working fine. I need the second and fourth buttons to point to the
current CGI script, but I need the third button to point to a
different CGI script. I need the second, third and fourth buttons to
pass their respective scripts all data entered on the form.
My clients will be using the most recent versions of IE and Netscape.
Is below a workable method of doing this? I will not be able to
actually test this myself until tomorrow. I've looked at the FAQs,
and there are many ways of using <input type...> to point to different
CGI scripts with different buttons, but because I'm using hyperlink
images to call submit, I don't know that the answers I found apply to
this particular problem.
If this isn't a workable method, could someone please provide me with
some code that is workable? Unfortunatley, I'm not a JavaScript guru,
and this is the best up with which I could come (I also tried using
functions, changing the document directly with syntax found on the
FAQs, but to no avail).
Thanks much!
<html>
<head>
<link rel="stylesheet" href="myCSS.css">
<SCRIPT LANGUAGE = "JavaScript" src="myJS.js">
</SCRIPT>
</head>
<body bgcolor=#00CCFF>
<!-- Lots of CGI script code -->
<form name="form1" action="p1.cgi">
<input type="text" name="input">
<br><br>
<a href='javascript:history.back();'
onMouseover="b1.src='i1_on.gif';"
onMouseout="b1.src='i1_off.gif';">
<img SRC="i1_off.gif"></a>
<a href='javascript:document.form1.submit();'
onMouseover="b2.src='i2_on.gif';"
onMouseout="b2.src='i2_off.gif';">
<img SRC="i2_off.gif"></a>
<!-- Change the form location. Will this get the data
on the form, as well as change the location? -->
<a href='javascript: document.form1.action = "p2.cgi";
javascript:document.form1.submit();'
onMouseover="b3.src='i3_on.gif';"
onMouseout="b3.src='i3_off.gif';">
<img SRC="i3_off.gif"></a>
<!-- Change the form location back to its original location. -->
<a href='javascript: document.form1.action = "p1.cgi";
javascript:document.form1.submit();'
onMouseover="b4.src='i4_on.gif';"
onMouseout="b4.src='i4_off.gif';">
<img SRC="i4_off.gif"></a>
</form>
</body>
</html>