Pergunta

I have a submit form in my website which works well with Firefox but does not work on Chrome and Safari. The input textbox is the only element giving trouble, all the other elements work fine with every browser. Do someone have a solution for this?

Here is the code of the textbox:

<div class="form-input-half-left form-input-border">
    <div class="form-input-background opacity_2"></div>
    <input id="name" type="text" name="x_first_name" value="name *" onclick="this.value = '';"/>
    <span class="error"> <?php echo $x_first_nameErr;?></span>
    </div>
Foi útil?

Solução

i tried your code here in jsfiddle and works fine in both chrome and firefox.i couldn't replicate the error, but i think you can use placeholder for your purpose and it works much more better than onclick

<input id="name" type="text" name="x_first_name" placeholder="name *"/>

may i know the problem is on which version of chrome and what is the problem exactly? it doesn't clear the text box or something else?

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top