I.E. 9.0 vs Firefox 14.1

Posted on 2012-08-23
Last Modified: 2012-08-28
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;
for i = 0 to 100
      Qtyx = "Qty"&i
if request(Qtyx) <> "" then
      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>
<% next %>
Question by:dcass
    LVL 9

    Expert Comment

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

    Author Comment

    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.
    LVL 9

    Assisted Solution

    Could you post the final HTML rendered ??? Because I would like to see the code without the <% %> tags.. Which, the browser doesn't see ! Replaced by the server.

    And you are right, using a variable as the id to get the element should work.

    Accepted Solution

    I'm such a dummy - I had the input field & also had it hidden so it was being treated as an array.   Sorry but thank you very much!

    Author Closing Comment

    I found the solution

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Suggested Solutions

    Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
    Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
    In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
    In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now