문제

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