Philippe Posted March 13, 2007 Share Posted March 13, 2007 When I change my HTML page containing a form to XHTML, I "must" remove the name attribute, but when I do that I can no longer read my formfields using the $_REQUEST.Is there another way to retrieve the formfields if you ommit the name attribute ?XHTML code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html> <head> <title>Skelet</title> <script type="text/javascript"> </script> </head> <body onload=""> <form id="aForm" action="test.php"> <p> <input id="submitButton" type="submit" value="Click me !" /> <input id="hiddenField" type="hidden" value="hiddenValue" /> </p> </form> </body></html> PHP-code echo $_REQUEST["hiddenField"]; Link to comment Share on other sites More sharing options...
aspnetguy Posted March 13, 2007 Share Posted March 13, 2007 the XHTML1 spec says this Finally, note that XHTML 1.0 has deprecated the name attribute of the a, applet, form, frame, iframe, img, and map elements, and it will be removed from XHTML in subsequent versions.I cannot find where it says that name is depreciated for input.http://www.w3.org/TR/xhtml1/ Link to comment Share on other sites More sharing options...
Philippe Posted March 13, 2007 Author Share Posted March 13, 2007 the XHTML1 spec says thisI cannot find where it says that name is depreciated for input.http://www.w3.org/TR/xhtml1/ Damn :)You're right, my code passes the validator, I must off had a weak moment there Can I delete my topic ? :)This is a bit complicated, you can use it with input and not with other elements ... anyway thanks for pointing this out to me ! Link to comment Share on other sites More sharing options...
aspnetguy Posted March 13, 2007 Share Posted March 13, 2007 I am sure they left it for inputs because W3C knows that many programming languages use it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now