tags:

views:

84

answers:

2

I only know how to get POST values via named elements, such as:

<?php
$value = $_POST['value'];

But that would require naming my form elements, which does not validate.

The invalid code would look something like this:

<form id="myForm" method="post" action="#">
<input type="text" name="text" />
+2  A: 

The lines you provide are valid. There must be some other part of the html that is invalid.

MitMaro
Ah, I've figured it out. Naming a form itself is invalid in strict DTD, but you can name the form elements.
Joseph Carrington
Easy mistake to make. When in doubt best to run your code through the w3c validation service.
MitMaro
+4  A: 

AFAIK, the name attribute is not deprecated for form fields. However, standards say that there should be at least one block-level element wrapping fields within a form (such as a fieldset tag).

Amber