Subject: [xsl] Radio type and Button: Need help, please From: Tran Thanh Dinh <dinh107@xxxxxxxxx> Date: Tue, 19 Jul 2005 08:30:09 -0700 (PDT) |
Hi, In my program, i want that when i click the button, the radio value will be taken as input parameter for button onclick. But I always have 'undefined' value for radio value and can not figure out what i should change in my following code. Please help me to find out please Thanks a lot, Have a nice day Dinh Tran. (contacts.xsl) <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/TR/WD-xsl"> <xsl:template match="/"> <html> <head> <script type="text/javascript" src="util.js"> </script> <title>Welcome</title> </head> <body> <table border="0" width="100%"> <form name="contacts"> <xsl:for-each select="c/e"> <tr><td> <input type="radio" name="c"> <xsl:attribute name="value"> <xsl:value-of select="p"/> </xsl:attribute> <xsl:value-of select="n"/> </input> </td></tr> </xsl:for-each> </form> <form name="acto"> <tr><td> <input class = "button" type="button" name ="actionCall" value = "call" OnClick='call("dfgsd");' /> <input class = "button" type="button" name = "actionSms" value = "sms" OnClick='sms(document.forms.contacts.c.value);' /> </td></tr> </form> </table> <script type="text/javascript"> var contactform= document.forms.contacts.c if (contactform == null){ document.forms.acto.actionCall.disabled = true; document.forms.acto.actionSms.disabled = true; } else{ if(contactform.length == null){ if(contactform!=null){ contactform.checked=true; } } else{ contactform[0].checked=true; } } </script> </body> </html> </xsl:template> </xsl:stylesheet> (contact.xml) <?xml version="1.0" encoding="ISO-8859-1" ?> <c> <e><n>Jason</n><p>+33603818993</p></e> <e><n>Gaby</n><p>+33614266956</p></e> <e><n>Hanson</n><p>+33618448665</p></e> <e><n>David</n><p>+33613407307</p></e> </c> (contacts.html) <html> <head /> <body> <script type="text/javascript"> // Load XML var xml = new ActiveXObject("Microsoft.XMLDOM") xml.async = false xml.load("contacts.xml") // Load XSL var xsl = new ActiveXObject("Microsoft.XMLDOM") xsl.async = false xsl.load("contacts.xsl") // Transform document.write(xml.transformNode(xsl)) </script> </body> </html> (util.js) function call(contactAddress){ document.write(contactAddress); return true; } function sms(contactAddress){ document.write(contactAddress); return true; } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Need help correcting XSL, David Carlisle | Thread | Re: [xsl] Radio type and Button: Ne, Joris Gillis |
RE: [xsl] Generating User Interface, Angel Gavin | Date | [xsl] getting "could not create ext, Viresh Jain |
Month |