Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Re: Forms and interaction in CGI

by khelben (Initiate)
on Sep 11, 2003 at 10:06 UTC ( [id://290632]=note: print w/replies, xml ) Need Help??

in reply to Re: Forms and interaction in CGI
in thread Forms and interaction in CGI

This works good, thanks!
use CGI qw/:standard/; print header, start_html('Simple Script'), h1('Simple Script'), start_form, "What's your name? ",textfield('name'),p, "What's the combination?", checkbox_group(-name=>'words', -values=>['eenie','meenie','minie','moe'], -defaults=>['eenie','moe']),p, "What's your favorite color?", popup_menu(-name=>'color', -values=>['red','green','blue','chartreuse']),p, submit, end_form, hr,"\n"; if (param) { print "Your name is ",em(param('name')),p, "The keywords are: ",em(join(", ",param('words'))),p, "Your favorite color is ",em(param('color')),".\n"; } print end_html;
Im not quite sure what you mean here, you need an integer stored in a variable?
$variable = 42;
Can you rephrase?

Maybe: "What's your name? ",textfield('name'),p,
Here i need a number.
Can I change the text of the button "Submit Query"?
How can I put the output in a textfield with scrollbars?


Replies are listed 'Best First'.
Re: Re: Re: Forms and interaction in CGI
by tachyon (Chancellor) on Sep 11, 2003 at 10:50 UTC

    A textfield will take text including numbers, it is up to you to check if the user submitted a number on the server. As for changing the button text:

    use CGI ':standard'; print submit( suggestion => 'RTFM' ); __DATA__ <input type="submit" name="suggestion" value="RTFM" />




Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-07-25 04:30 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.