Print Reseller Scheme
  1. 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

Discussion in 'Website Design Forum:' started by Wizard, Jul 13, 2010.

  1. Wizard

    Wizard 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:

    <HTML>
    <HEAD>
    </HEAD>
    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">
    </BODY>
    </HTML>

    I'd be really grateful for any suggestions please?

    Thanks in advance
     
  2. Jazajay

    Jazajay 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. :)
     

Share This Page