We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16702 ☆ A M B ☆
    • 536 Posts
    Hi,

    i thing something like this:

    <input id="1" name="post[email]" value="E-mail Address" style="width:100%; text-align: center; color: grey; margin-bottom: 10px;" onblur="if (this.value == ’’) {this.value = ’E-mail Address’; this.style.color = ’grey’;}" onfocus="if (this.value == ’E-mail Address’) {this.value = ’’; this.style.color = ’#000000’; }" />

    but is not work correctly in all situation`s.
    other ideas?

    !0x

    P.S> or something with Jquery?
      palma non sine pulvere
      • 24414
      • 45 Posts
      Here’s a couple of ways to add your label content to text inputs –

      Autopopulating text input fields with JavaScript (456 Berea St)

      Takes the label, hides it and adds its content to the input box.

      Using form labels as text field values (CSS Globe)

      ...does the same but with jQuery.

        • 16702 ☆ A M B ☆
        • 536 Posts
        Last Of The Romans Reply #3, 17 years, 1 month ago
        Quote from: ram at Aug 20, 2009, 03:49 PM

        Here’s a couple of ways to add your label content to text inputs –

        Autopopulating text input fields with JavaScript (456 Berea St)

        Takes the label, hides it and adds its content to the input box.

        Using form labels as text field values (CSS Globe)

        ...does the same but with jQuery.




        perfect! smiley
        Thank you


        P>S> Autopopulating text input fields with JavaScript (456 Berea St) - is nice work pretty good, fast and "plastic"
          palma non sine pulvere