Changing to lower case letter of text box data with onBlur eventWE can change the case of entered text inside a text box. We can change the text to all uppercase or to all lower case letters as per the requirements. This is done in case of entering user ids in login forms were all ids are stored in either lower case or upper case letters. If user ids are stored as lower case letters then before comparing we need to convert entered id to lower case and show it to the user that this is the case thy have to enter. For example if some one entered user id as John then it is to be converted as john inside the text box. convert the uppercase letter to lower case text. This function will be trigged by the onBlur event handler of the text box. This is the text box code we ill use inside the form where we have kept some default text also.
Now when ever the curser moves out of the text box ( we call it onBlur ) the event handler will trigger the function change_case. Inside this function change_case we will change the value to lower case by using toLowerCase function. Here is the complete code.
OnBlur event is used to convert any input value in meter to Feet ( and vice versa ) OnBlur event is used to convert inches to cm ( and vice versa )
This article is written by plus2net.com team.