iamgoondu Posted November 16, 2006 Share Posted November 16, 2006 Hi,I had a variable called sSlotID. I would like to pass the variable into the NAME OF THE INPUT TEXTBOX, how can I do it?Thanks alot!<xsl:for-each select="Input/SelectedSlots/SelectedSlot"><script language="JScript"><![CDATA[var sSlotID = "]]><xsl:value-of select="SlotID"/><![CDATA[";]]>document.write(sSlotID)</script> <TR><TD align = "center" colspan="3" ><font size="1"> <xsl:value-of select="sSlotID"/> </font></TD> <TD colspan="3"><INPUT id="txt" type="textbox" name="SlotID" ></INPUT></TD></TR> </xsl:for-each> Link to comment Share on other sites More sharing options...
Chocolate570 Posted November 16, 2006 Share Posted November 16, 2006 Just use this:<script type="text/javascript">x=document.getElementById("txt");x.name=sSlotID</script> Link to comment Share on other sites More sharing options...
iamgoondu Posted November 16, 2006 Author Share Posted November 16, 2006 Just use this:<script type="text/javascript">x=document.getElementById("txt");x.name=sSlotID</script>But what is x and txt? Link to comment Share on other sites More sharing options...
jesh Posted November 16, 2006 Share Posted November 16, 2006 But what is x and txt?x is just a variable, you could name it "goondu" if you wanted. txt is the ID of your input element. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now