Getting LABEL for=...

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi y'all,
is there anyway that I can get the <LABEL for=... data from a form in PHP.

For example, if I have

<label for="name">Full name</label><br>
            <input type="text" size="40" name="name" id="name"></p>

Can I get the fact that the label for "name" is "Full name"


Re: Getting LABEL for=...

Paul Lautman wrote:

Quoted text here. Click to load it

Hi Paul,

yes and no.

No: In your current setup you just send the formelements to PHP.
Tip: You can ALWAYS check what PHP receives by printing the $_POST, like  


(The pre's are important, if you don't use them, it will be difficult to  


Yes, by adding extra info to your form, probably with a hidden variable,  
like this:
<input type="hidden" name="labelforname" value="Full name">

Erwin Moller

Re: Getting LABEL for=...

Thank you Erwin for your speedy reply.  

Site Timeline