Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Firefox Error

Status
Not open for further replies.

indupriya9

Programmer
Joined
Oct 29, 2002
Messages
99
Location
NZ
Hi everyone

I have a code that works in IE but not in Firefox.

Here is the code I have in an xsl document that is refereed to by an asp document.

Code:
function addtoorderform(rid,prodId,proname,UnitPrice,no)
{
var nX;
var Qty;
nX=eval("document.getElementById('txtQty" + no +"')");
alert(nX.value);
Qty=nX.value;
if(nX.disabled!=true)
{window.opener.popSetTicker(rid,prodId,proname,UnitPrice,Qty);}
	nX.disabled=true
}

The function is called below

<input type="button" src="../images/add.gif" script="javascript" Value="Add to Order" class="chartButt" >
<xsl:attribute name="name">O__<xsl:number value="position()" format="1" /></xsl:attribute>
<xsl:attribute name="onclick">addtoorderform('<xsl:value-of select="rId" />','<xsl:value-of select="Code_" />','<xsl:value-of select="Product_Name" />','<xsl:value-of select="Price" />','<xsl:number value="position()" format="1" />')</xsl:attribute>
</input>


The error I see in Firefox is :

nX has no properties in Line 9

Can somebody please let me know how this can be fixed

Thanks in advance
 
This won't answer the question.
>[tt]nX=eval("document.getElementById('txtQty" + no +"')");[/tt]
Simply use this instead.
[tt]nX=document.getElementById('txtQty' + no);[/tt]

>The function is called below
In what sense, it is called below?

 
Hi tsuji

Sorry for the really long delay in replying to this thread. When I try to use the code that you suggested there was no change in IE functionality but it still does not add the row to the relevant form. The error in the Java console is "nX has no properties".

Any other ideas on how I can fix this problem?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top