Link to home
Start Free TrialLog in
Avatar of dcass
dcassFlag for United States of America

asked on

I.E. 9.0 vs Firefox 14.1

Could someone tell me why this works in Firefox and not in I.E.?
Either onclick or onchange - the screen comes back exactly like it was before qty is changed in I.E..  I've tested and the input qty is not getting passed to the javascript - it remains the same as it was before it was changed.  I've tried getelementsbyname - it doesn't work either - same exact problem.  

<script type="text/javascript">
function qtychg(ind)
{
  var i = ind;
  var sqty = "qty"+i;
  var qty=document.getElementById(sqty).value;
  var slink = "ordercc.asp?Qty"+i+"="+qty;
  document.forms[0].action=slink;
  document.forms[0].submit();
}
</script>
<%
for i = 0 to 100
      Qtyx = "Qty"&i
if request(Qtyx) <> "" then
      qty=request(Qtyx)
else
      Qty = request.form(Qtyx)
end if
%>
<td   width="50"  align=center bgcolor="<%=bgcolr%>"><font style="font-size:14px;color:#898989;font-family:Arial"><b>
<input type=text id="qty<%=x%>" value="<%=Qty%>" name="qtyx<%=x%>" size=1 onchange="qtychg('<%=x%>')"><img src=images/down.jpg  style=vertical-
align:middle; onclick="qtychg('<%=x%>');" width=12 height=16></b>
</td>
<% next %>
Avatar of djon2003
djon2003
Flag of Canada image

Could we get the final rendering result ? Or the URL to that page ?
Avatar of dcass

ASKER

If you want to test or look at it, sorry - it's behind a log in and a confidentiality agreement.
The question is why does javascript (either getelementbyid or getelementsbyname) only work in Firefox?  
Is it because I'm using a variable for the value of the input field Qty?
That doesn't make sense to me.
Maybe it would help to know I'm just going through a loop for qty0, qty1 ... thru qty100 and of it gets changed, it should be picked up by getelement..., right?  Because it is in Firefox.
Plus the onclick, onchange and onlostfocus all behave the same way in each respective browser.
SOLUTION
Avatar of djon2003
djon2003
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dcass

ASKER

I found the solution