Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Form events

Form events

Form events

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?

RE: Form events

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?


Spend an hour a week on CPAN, helps cure all known programming ailments winky smile

RE: Form events


If already use JavaScript, then use only one form and just change the action :


<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'">


RE: Form events

never thought of that, have a *

Spend an hour a week on CPAN, helps cure all known programming ailments winky smile

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close