Menu

How to setup a field so the default info clears when field selected

Help
2014-01-27
2014-01-27
  • Mike Crabill

    Mike Crabill - 2014-01-27

    I use the phpformgenerator a lot and really appreciate it's convenience. I have one project I am helping with, where he doesn't want the field labels above the fields. He wants them in the field itself and then clear when the field is selected. Is there a way I can modify the form so that it will work that way?

     
  • Mike Crabill

    Mike Crabill - 2014-01-27

    OK, I put my thinking cap on and figured it out. For anyone else who might want to know how to do this also. You just have to modify the form line, so that the "value" is changed to "placeholder" when you do this the default text disappears when you start typing in the field.
    an example:


  • <label class="formFieldQuestion"></label><input class="mainForm" type="email" name="field_2" id="field_2" size="25" value="Primary Email Address">
  • modify to:


  • <label class="formFieldQuestion"></label><input class="mainForm" type="email" name="field_2" id="field_2" size="25" placeholder="Primary Email Address">
 

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.