tags:

views:

18

answers:

2

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???

A: 

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();"

that's the line.. it didn't take earlier
A: 

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()" >
mplungjan
thanks... in the end I used the onfocus with he javascript entervalue() and it works great... forget the 1st rule of programming... Keep It Simple..
so calling a script that needs the form name of a form you cannot enter is better than not using form at all?
mplungjan