how to check loginname field onfocus

Posted by edpnaga@gmail.com on 28-Apr-2016 04:13

IN PORTAL :  Get text enter mail id besides the login field when click login Name field, same way Password field also need to show some text.how to write JavaScript, below portal login page.

All Replies

Posted by Varun Tayal on 29-Apr-2016 01:57

Hi,

Try the following script in login Page-

<script>

$(document).ready(function() {

 $(document.loginForm.loginName).focus(function() {$(document.loginForm.loginName).after("<span>Enter Email Id</span>")});

 $(document.loginForm.password).focus(function() {$(document.loginForm.password).after("<span>Enter Password</span>")});

 $(document.loginForm.loginName).focus();

});

</script>

This thread is closed