Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Executing perl script with html textarea

by space_monk (Chaplain)
on May 21, 2013 at 17:08 UTC ( #1034570=note: print w/replies, xml ) Need Help??

in reply to Executing perl script with html textarea

I think most of the answer to this question is HTML not Perl, but I'll answer it anyway.

The easy way of selecting a question would be an HTML select list.

<form method="post" action="http://myserver/perl_script"> <p>Which question do you want to answer? <select name="question"> <option value="1">Question 1</option> <option value="2">Question 2</option> <option value="3">Question 3</option> <option value="4">Question 4</option> </select> </p> <p>Answer your question in the textbox:<br /> <textarea name="answer" rows="20" cols="70"></textarea> <input type="submit" value="submit"/> </form>
The Perl script to read the answers would be something like
#!/usr/bin/perl use strict; use warnings; use CGI; my $cgi = CGI->new; my $question= $cgi->param("question"); my $answer = $cgi->param("answer");
If you spot any bugs in my solutions, it's because I've deliberately left them in as an exercise for the reader! :-)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1034570]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2017-03-24 22:22 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (308 votes). Check out past polls.