Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: How to perform different actions before and after submit button is clicked.

by tangent (Parson)
on Aug 31, 2015 at 23:12 UTC ( [id://1140582]=note: print w/replies, xml ) Need Help??


in reply to [Solved]: How to perform different actions before and after submit button is clicked.

To get the value of a form input you need to give it a name, so change your button to:
<input type="submit" name="button1" value="Submit" />
Then you can see if it was clicked:
print '<html><head><title>Test</title></head><body>'; if ( $query->param('button1') ) { print 'Thank you - your form was submitted correctly!'; } else { print '<form method="post"><input type="submit" name="button1" val +ue="Submit"></form>'; } print '</body></html>';

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1140582]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 05:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found