Forum Moderators: open

Message Too Old, No Replies

form not posting in XHTML 1.0 strict

form posts with deprecated name="" but not without

         

sneaks

9:50 pm on Jan 20, 2007 (gmt 0)

10+ Year Member



can anyone explain to me why my form doesnt post when i exclude the name attribute? w3c doesnt validate name attribute on form for xhtml strict document type.

its 'post'ing to a php... its just weird how it works with name but not without...
arghhhhhh

cameraman

10:06 pm on Jan 20, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



?
This is working for me:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body bgcolor="#FFFFFF" text="#000000">
<?php if(isset($_POST['Submit'])) echo "<p>Submitted: " . $_POST['textfield'] . "</p>\n";?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
<input type="text" name="textfield" />
<input type="submit" name="Submit" value="Submit" />
</form>
</body>
</html>

sneaks

10:19 pm on Jan 20, 2007 (gmt 0)

10+ Year Member



heres my code, the $_POST array is blank without the 'name' attribute...


<form action="./modular.php?item=contact" method="post" enctype="application/x-www-form-urlencoded">
<?php print_r ($_POST);?>
<div>
Name<input id="name" type="text" <?php if (isset($_POST['name'])) print 'value="' . $_POST['name'] . '"';?> />
e-Mail<input id="email" type="text" <?php if (isset($_POST['email'])) print 'value="' . $_POST['email'] . '"';?> />
Message<textarea id="message" cols="40" rows="15" style="font-family: Arial, Helvetica, sans-serif; font-size: 10px;"><?php if (isset($_POST['message'])) print $_POST['message'];?></textarea>
<input class="buttonSubmit" type="submit" value="Send" />
</div>
</form>

sneaks

10:25 pm on Jan 20, 2007 (gmt 0)

10+ Year Member



shoot its the names missing from the inputs... duh! i thought they were deprecated too... hehe

gotta cut down on sniffing markers.

thanks for the help though.

cameraman

10:57 pm on Jan 20, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ROFL but if you shouldn't sniff the markers what bloody good are they?