سؤال

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>
هل كانت مفيدة؟

المحلول

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?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top