Search Engine Optimization > Web Design > FORM question
FORM question
Posted by daniel kaplan on November 14th, 2004

new to html and i have to say that i am not getting any of the params into
my script, whether its GET or POST...

cause the access log is showing me nothing passed along....with either
method....


as a side question, am curious; can you put within the <FORM> </FORM>
tables, cells, and rows, etc?


thanks





Posted by Tom Szabo on November 14th, 2004



Perhaps a little code axample would help :-)

Yes, certainly, you can put tables inside tables inside font inside form....

Regards,

Tom



Posted by daniel kaplan on November 14th, 2004

<FORM action="http://www.example.com/cgi-bin/newuser.pl" method="POST">
<LABEL for="email">Email<BR></LABEL>
<INPUT type="text" id="email"><BR>
<INPUT type="submit" value=" Add ">
</FORM>


and on the receiving end:

#!/usr/bin/perl -T

use warnings;
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use DBI;

my $q = new CGI;
my ($out);

my $email = lc($q->param('email'));

but $email is noting

and the access log showes no params, even when i switched to GET to test


Posted by daniel kaplan on November 14th, 2004

working now...i had copied a sample code from
http://www.w3.org/TR/REC-html40/inte...ms.html#h-17.1 (***below)

and in the first few fields they used id instead of name...now am still new
to this and haven't researched it yet (diff between id and name) but that
was the problem....i will research it soon, but wanted to post so no one
wastes their time looking at, figuring out, etc....responding

thanks

(***)
<FORM action="http://somesite.com/prog/adduser" method="post">
<P>
<LABEL for="firstname">First name: </LABEL>
<INPUT type="text" id="firstname"><BR>
<LABEL for="lastname">Last name: </LABEL>
<INPUT type="text" id="lastname"><BR>
<LABEL for="email">email: </LABEL>
<INPUT type="text" id="email"><BR>
<INPUT type="radio" name="sex" value="Male"> Male<BR>
<INPUT type="radio" name="sex" value="Female"> Female<BR>
<INPUT type="submit" value="Send"> <INPUT type="reset">
</P>
</FORM>


Posted by Adrienne on November 14th, 2004

Gazing into my crystal ball I observed "daniel kaplan"
<nospam@nospam.com> writing in news:1100462615.117003@nntp.acecape.com:

The difference between name and id is this - id can only be used for one
element only, name can be used for many.

For example:
<input type="radio" name="choice" id="choice1" value="vanilla">
<input type="radio" name="choice" id="choice2" value="chocolate">
<input type="radio" name="choice" id="choice3" value="strawberry">

Javascript and other client side goodies can access the id attribute, and
the server side script uses the values in the name attribute, hence,
"name/value" pairs are what is passed to the script.

Here's two things you might want to also look at while you're learning:
http://www.cs.tut.fi/~jkorpela/forms/index.html - (all about forms)
http://www.intraproducts.com/beta/requiredform.asp - (making an
accessible form)

Here's the skinny on the two attributes:
name - http://www.w3.org/TR/html401/interac...l#control-name
id - http://www.w3.org/TR/html401/struct/global.html#adef-id

HTH
--
Adrienne Boswell
Please respond to the group so others can share

Funbolt.com - Entertainment portal, wallpapers, sexy celebs