validation - Adding place holder by jquery doesn't work fine -
i have input field id 'datepicker'
while validating, if date mentioned not valid
i empty field , adding placeholder
if(validationfails) { $("#datepicker").val(''); $("#datepicker").attr('placeholder',"mm/dd/yyyy") } now input field doesn't have anything, placeholder missing.
if focus input field , press "backspace"
the place holder "mm/dd/yyyy" appears
try change code one. enclose ids in quotes.
if(validationfails) { $('#datepicker').val(''); $('#datepicker').attr('placeholder',"mm/dd/yyyy") }
Comments
Post a Comment