April 12, 201016 yr Hey again everyone. Sorry for mutliple posts. I have an input field which has default text in it that clears when the user clicks it. However the text only reappear when you refresh the page. Ideally I'd like the text to appear in the text move again as soon as the user clicks somewhere else in teh page. Here is my code at the moment. <input class="last" name="txtCriteria" type="text" value="enter road name or postcode" id="postcode" onclick="this.value = '';" maxlength="20"/> May I want some kind of offclick on onmouseout command? Thanks for any help
April 12, 201016 yr You want to replace "onclick" with a combination of "onfocus" and "onblur". If you'll pardon the shameless self-promotion, a little while ago I wrote a script to do exactly what you're talking about, and I explained each part of the script and the reasons behind it Clearing the Value of Form Elements Of course, I wrote that over 6 months ago and I'd probably doa coupe of things differently now but the basics are all there and the script will fundimentally work
Create an account or sign in to comment