• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HTML5 placeholder attribute and form_validation

#1
[eluser]piddleton[/eluser]
Couldn't find anything on this topic, but my goal is to use the HTML5 "placeholder" attribute to show grey text in a form field telling the user what to enter, e.g. "Name."

I'm also using set_value to make sure that if the user submits several form fields and they don't validate, the values they enter remain in the input text boxes.

However, if I use both the placeholder and set_value on a form field, I can't get both to work: When the form first loads, if I use set_value, the placeholder text doesn't appear. So I removed set_value and the placeholder text appears. Then if I submit the form and that text field has an error, since I removed set_value, only the placeholder text appears in the input field.

Is there a CI way around this? Or, if I want to use set_value and placeholder at the same time, should I check if $_POST exists and use either placeholder or set_value?


Messages In This Thread
HTML5 placeholder attribute and form_validation - by El Forum - 06-04-2012, 11:20 AM
HTML5 placeholder attribute and form_validation - by El Forum - 06-04-2012, 11:37 AM
HTML5 placeholder attribute and form_validation - by El Forum - 06-04-2012, 12:12 PM
HTML5 placeholder attribute and form_validation - by El Forum - 06-04-2012, 12:50 PM
HTML5 placeholder attribute and form_validation - by El Forum - 06-04-2012, 01:31 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.