dcass
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.getElementByI d(sqty).va lue;
var slink = "ordercc.asp?Qty"+i+"="+qt y;
document.forms[0].action=s link;
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%>"><fon t style="font-size:14px;colo r:#898989; font-famil y: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 %>
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.getElementByI
var slink = "ordercc.asp?Qty"+i+"="+qt
document.forms[0].action=s
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%>"><fon
<input type=text id="qty<%=x%>" value="<%=Qty%>" name="qtyx<%=x%>" size=1 onchange="qtychg('<%=x%>')
align:middle; onclick="qtychg('<%=x%>');
</td>
<% next %>
Could we get the final rendering result ? Or the URL to that page ?
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I found the solution