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

call JavaScript when radio-button is checked

Subject: call JavaScript when radio-button is checked
From: "Laura Madonna" <Laura.Madonna@xxxxxxxxx>
Date: Wed, 15 Sep 2004 17:03:13 -0600
javascript radio
When my webpage is displayed: if a particular Radio Button is already checked
on ("Y"), then a specific text fields on the page should be disabled .  The
xsl code works   fine when the user toggles the Radio Button.  The onclick
attribute calls a JavaScript function that disables the text fields.   I need
help figuring out how to call that JavaScript when the page loads or is
refreshed.  How do I call that JavaScript when the page loads?   It is tricky
because I have to check that the radio button is on and that another tag,
provider_link_cu, is not blank.
Below is my function and the sample radio button that calls the function
"onclick".

    function disableTextField (obj)
     {
       <xsl:for-each select="dependent">
          obj.<xsl:value-of select="hlth_provider_idVarName"/>.disabled=true;
          obj.<xsl:value-of select="hlth_provider_idVarName"/>.value='';
          obj.pcp<xsl:value-of
select="hlth_provider_idVarName"/>.disabled=true;
       </xsl:for-each>
     }

 <xsl:for-each select="radio">
     <xsl:element name="INPUT">
        <xsl:attribute name="TYPE">RADIO</xsl:attribute>
        <xsl:attribute name="NAME"><xsl:value-of select="name"/>
</xsl:attribute>
       <xsl:attribute name="VALUE"><xsl:value-of
select="value"/></xsl:attribute>
       <xsl:if test="checked='Y'">
           <xsl:attribute
name="class">uportal-background-highlight</xsl:attribute>
           <xsl:attribute name="CHECKED">checked</xsl:attribute>
           <!--IF provider is blank, disable-->
           <xsl:if test="( ../provider_link_cu = ' ' ) ">
                   <xsl:attribute
name="onClick">javascript:disableTextField(this.form )</xsl:attribute>
           </xsl:if>
       </xsl:if>
     </xsl:element>
</xsl:for-each> <!-- radio -->

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.