Getting LABEL for=...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul Lautman

    #1

    Getting LABEL for=...

    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"

    TIA
    Regards
    Paul


  • Erwin Moller

    #2
    Re: Getting LABEL for=...

    Paul Lautman wrote:
    [color=blue]
    > 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"
    >
    > TIA
    > Regards
    > Paul[/color]


    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
    this:

    <pre>
    <?
    print_r($_POST) ;
    ?>
    </pre>

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

    ----------------

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


    Regards,
    Erwin Moller

    Comment

    • Paul Lautman

      #3
      Re: Getting LABEL for=...

      Thank you Erwin for your speedy reply.


      Comment

      Working...