[eluser]mact1079[/eluser]
I'd like to be able to display a user's input in an email field instead of wiping it out if form validation fails. If I don't have the field name in the field and were using labels I'd simply make 'value'=>set_value('email') however as you see below I have an
onfocus and
onblur call as this is a mobile form and I don't want to take up the screen space for labels.
Any ideas on how to retain the user's input with a modification to my code below if form validation fails, while initially having the field name in the field?
Code:
$useremail = array('name'=>'email', 'type'=>'email', 'value'=>'Email Address', 'onfocus'=>"if (value='Email Address') {value=''}",'onblur'=>"if (value=='') {value='Email Address'}");