CGI.pretty and textarea

J

Jeff Dickens

I created form with this code:

def form(cgi)
CGI.pretty(
cgi.html {
cgi.head { cgi.title{"This is my form"} } +
cgi.body {
cgi.h1 {"Test Form"} +
cgi.form {
cgi.textarea("get_text") {"This is some text"} +
cgi.br +
cgi.submit({'value'=>'Submit', 'name'=>'submit'})
} #cgi.form
} #cgi.body
} #cgi.html
) #CGI.pretty
end

and the output is this:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>
This is my form
</title>
</head>
<body>
<h1>
Test Form
</h1>
<form METHOD="post" ENCTYPE="application/x-www-form-urlencoded"
ACTION="/test/ruby/test.cgi">
<textarea NAME="get_text" ROWS="10" COLS="70">
This is some text
</textarea>
<br>
<input name="submit" TYPE="submit" value="Submit">
</form>
</body>
</html>This causes extraneous white-space in the textarea. I know this
isn't a problem specific to ruby, but does anyone have a workaround short of
not using CGI.pretty?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top