简体   繁体   中英

XSLT if Checkbox Clicked disable the Textbox

XSLT if Checkbox Clicked disable the Textbox

 <TD colspan="2">
                        <input type="checkbox" name="City$store1$" onclick="SetBonPerAcre(this)" TabIndex="19">
                        <xsl:if test="City/@store1=1">

                        <xsl:attribute name="checked"></xsl:attribute>
                        </xsl:if>
                        </input>fee&#160;&#160;&#160;&#160;&#160;&#160;
                    <input type="text" id="1001" maxlength="100" value="{City/@RE}"></input>
                    <input type="text" id="1002" maxlength="100" value="{City/@E}"></input>
                  </TD>

if Checkbox Checked i want disable textboxes with id 1001 and 1002

Use the same test that you have currently implemented for the checkbox, but instead add a 'disabled' attribute to the inputs:

<input type="text" id="1001" maxlength="100" value="{City/@RE}">            
    <xsl:if test="City/@store1=1">
        <xsl:attribute name="disabled">true</xsl:attribute>
    </xsl:if>
</input>
<input type="text" id="1002" maxlength="100" value="{City/@E}">
    <xsl:if test="City/@store1=1">
        <xsl:attribute name="disabled">true</xsl:attribute>
    </xsl:if>
</input>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM