Login  Register

SELECT1 javascript testing for checked value

Posted by JohnBampton on Nov 26, 2009; 8:42am
URL: https://discuss.orbeon.com/SELECT1-javascript-testing-for-checked-value-tp788098.html

Hello, I have the following code and I only want to display the "surroundingwestcomment" div if the select1 is checked with value of "Yes".  So I need some javascript but I don't know what.  Any ideas?

<xhtml:div>d. West - <xforms:select1 id="surroundingwest"  ref="surrounding/west" appearance="full">
                         <xforms:choices><xforms:item><xforms:label>No exposures within 50'</xforms:label><xforms:value>No</xforms:value></xforms:item><xforms:item><xforms:label>Exposure within 50'</xforms:label><xforms:value>Yes</xforms:value></xforms:item></xforms:choices> </xforms:select1> 
                      <xhtml:br/>
                     
                     <xhtml:div id="surroundingwestcomment" style="display:none;">
                      Explain: <xhtml:br/> <xforms:textarea  ref="surrounding/westexplain"
                                                incremental="true"  mediatype="text/html">
                                                <xforms:alert/>
                                        </xforms:textarea> 
                     </xhtml:div>
                   </xhtml:div>