Hi rezachar,
I think dj's solution basically solves most of your problem. You just need to change the "post" method in the form to "get" if you want to have the variables displayed on the URL OR if you only handle GET variables.
As for JS, just use:
print "<a href=\"javascript:document
in your program to submit the form above.
Cheers!
Main Topics
Browse All Topics





by: djplaistowPosted on 2003-11-04 at 08:14:39ID: 9679521
The variables can not have the same names. The variable name must uniquely identify the variable.
.cgi">
I am not one hundred persent sure that I understand your question, so part of this is a guess. Instead of using a link to maintain the old variable's value, use hidden variables within the form itself. The perl might look like this:
print <<END_OF_TEXT;
<form name=yourForm method=post action="generate_next_page
<input type=hidden name=val1 value="$value1">
<input type=hidden name=val2 value="$value2">
New value 1:<input type=text name=newValue1 size=18>
New value 2:<input type=text name=newValue2 size=18>
<input type=submit name=pageSubmit>
</form>
END_OF_TEXT
Now when the user selects the submit button, the old values come in as val1 and val2. The new values come to the script as newValue1 and newValue2. Of course if your page looks better with a link for the submit than a button, just change the href's url to explicitly execute the JavaScript submit() method on the form. Incidently, the submit() method is the reason you should never name a submit button "submit" as is all too common.