• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

JavaScript onFocus / OnBlur query in Chrome


Junior Member
Hi all

I'm putting together a form and need to use some simple Javascript within it. I want to use the onFocus event to prompt the user with acceptable answers. I've tested the from in IE & Firefox and the script works fine but in Chrome I get caught in an infinite loop. It doesn't seem to be just my platform either; I've emailed the form to a couple of colleagues and they also get the same problem in Chrome.

I've put a highly simplified version of the HTML and Script below:

What is your favourite colour?
<input name="colour" type="text"size="20"maxlength="30" onFocus="window.alert('eg Red, green or blue.'); return true;" onBlur="self.status=' '; return true">

I'd be really grateful for any suggestions please?

Thanks in advance


Active Member
You could take out those returns fella.
But does it also kick in when you use Safari or is it just a Chrome issue?

I also cant see what your trying to do with the staus on blur either TBH. :)