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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form events 1

Status
Not open for further replies.

carl007

Programmer
Oct 2, 2006
1
US
Hi all,
I have a question about handling form events in CGI -perl.
I have a main form which has a action event(ACTION1) which is triggered when a
submit button(SUBMIT) is pressed. But then I have an additional button in the
main form(ADD)which on click should open a new form(ACTION2) to which i need to
pass values from the main form. Since a form can have only one action
event, I defined a seperate form and stored the definition of ADD
button in a perl variable which i referenced it the main form. But I
find the ADD button still triggers the main form's action event
eventhough it is defnition exists in a different form with action
attribute ACTION2. I guess it is because it is in the scope of main
form. It would be great if anyone can help me on how should i proceed?
Thanks
Carl
 
a submit button will submit the form to the action provided in tbe form declaration. Perhaps a bit of javascript to populate the new form, and give the new form a different action?

HTH
--Paul

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Hi

If already use JavaScript, then use only one form and just change the action :
Code:
<form action="complain_no_js.htm">
<input type="submit" value="Ok"  onclick="this.form.action='save.pl'">
<input type="submit" value="Add" onclick="this.form.action='add.pl'">
</form>

Feherke.
 
never thought of that, have a *

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top