Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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! :-)


Comment on Re: Executing perl script with html textarea
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2014-09-19 00:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (129 votes), past polls