[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Radio type and Button: Need help, please

Subject: Radio type and Button: Need help, please
From: Tran Thanh Dinh <dinh107@xxxxxxxxx>
Date: Tue, 19 Jul 2005 08:30:09 -0700 (PDT)
javascript radio undefined
  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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.