I want to use jQuery Masked Input Plugin (http://digitalbush.com/projects/masked-input-plugin/) in my registration form. My form looks like that
...
<input class="part1" type="text" name="lname" value="Last Name" onfocus="if(this.value=='Last name') {this.style.color='#aea592';this.style.fontStyle='normal'; this.value=''};" onblur="if(this.value=='') {this.style.color='#aea592'; this.style.fontStyle='italic'; this.value='Last name'}" />
<input class="part2" type="text" id="dob" name="dob" value="Date of Birth" onfocus="if(this.value=='Date of Birth') {this.style.color='#aea592';this.style.fontStyle='normal'; this.value=''};" onblur="if(this.value=='') {this.style.color='#aea592'; this.style.fontStyle='italic'; this.value='Date of Birth'}" />
...
a the end of the file
<script src="core/code/js/mask.js"></script>
<script type="text/javascript">
jQuery(function($) {
$('#dob').mask('99.99.9999', {placeholder:' '});
});
</script>
When you open the page, Last Name field shows word "Last name" but date of birth doesn't show anything. http://prntscr.com/2miaa How can i activate mask plugin for only onfocus event?