mathiasbynens/jquery-placeholder — Issue #60: Focus on Input field,after submitting the form with Unobtrusive Java script
Author: ongolenaveen
Created: 2012-02-26 15:50:24+00:00
State: open

Thank you for sharing this wonderful library. This is the best library available to display place holders.We are using this library along with ASP.net MVC application to display place holders. We come across one issue while working on Html forms , along with Unobtrusive Java scripton on IE7. If the HTML form is Empty and if some of the fields are mandatory, when we submit the form with out entering the mandatory fields, Unobtrusive Jscript wont allow you the post back to the server as mandatory fields validation failed and the first field Value which retains the focus is being overridden by Place holder value.

In order to reproduce the issue, please use the following test cases.

1)Create HTML form with Unobtrusive java script validation in it. Ex: Empty employee form with first name and surname fields as mandatory(i.e.data-val-required="The LasttName field is required.")

2) if we try to submit the form, with out entering last name field, Non obstructive Java script wont let you post to server and would show you error highlighting the field and the focus would have been moved on to last name. At this moment , if we move away focus to first name and come back to last name, Last name place holder wont get cleared and the Last name field value would be overriden by the Place holder.

Thanks and Regards,
Naveen