So I have a username and password field with the onfocus onblur script. Basically what happens is 1) When you first load the page - You will see Username and Password typed in already in the two form fields. 2) When you click on the username, the username type disappears and you are able to type in your username. Same thing happens with the password. 3) The problem is - On Firefox and Chrome both work out the way they are supposed too. However, on IE 8 - When you tab over to the password field, it gives me a JS error. "Could not get the type property. This command is not supported." Here is my code: <input class="search_textbox" value="Username" NAME="username" type="text" onfocus="clearText(this)" onblur="clearText(this)" /> <input class="search_textbox" type="text" name="password" value="Password" onFocus="if(this.value='Password'){this.value='';this.type='password';}"> <input type="submit" value="Login" class="search_button" /> Code (markup): Any help would be appreciated.
IE does not like to change the inpute type dynamicaly. You have to replace the element with a new input element with type="password". Another solution where you wont need to change the input fields would be to place a div above the input fields an simply hide it when you focus the input fields.
Nyu, thank you for your post. Would you mind coding the example you laid out? I would highly appreciate it.