开发者

onFocus error in IE

开发者 https://www.devze.com 2023-01-10 22:45 出处:网络
Why do I get an error in IE for this line of code: I used some stuff that works on the iPad but I was getting an error for the开发者_如何转开发 onFocus stuff before I even added it... here is the s

Why do I get an error in IE for this line of code:

I used some stuff that works on the iPad but I was getting an error for the开发者_如何转开发 onFocus stuff before I even added it... here is the script that runs on focus:

function enterValue () { document.form1.itemQuantity.value = ""; }

any idea's anyone???


input type="<% =sType %>" class="inputbox" name="itemQuantity" min="1" max="99" step="1" value="<%=varMinQuantity%>" maxlength="2" size="2" onfocus="enterValue()" onclick="this.Focus();this.Select();"


You are doing too many things. onClick WILL focus all by itself, no need to focus and this.select is lowercase

<input type="<% =sType %>" class="inputbox" name="itemQuantity" min="1" max="99" step="1" value="<%=varMinQuantity%>" maxlength="2" size="2" onfocus="this.value=''" >

OR BETTER:

<input type="<% =sType %>" class="inputbox" name="itemQuantity" min="1" max="99" step="1" value="<%=varMinQuantity%>" maxlength="2" size="2" onfocus="this.select()" >
0

精彩评论

暂无评论...
验证码 换一张
取 消