1 Reply Latest reply on Feb 26, 2012 6:26 AM by BKBK

    How to Enable/Disable form item, with changing on CFSELECT on FLASH type CFFORM.

    Ali Parsa

      Hi,

      i have a problem with my small code.

       

      i have a CFFORM on FLASH mode. I have an CFSELECT itehm and 1 CFINPUT TEXT, so i need to Enable my text box when  i select "OTHER" from CFSELECT and disable the text box if i have other choice .

       

      <cfform name="pipe_add" action="kooft.cfm" enctype="multipart/form-data" method="post" format="flash" skin="haloorange" width="300" height="850">

       

                  <cfformitem type="script">

                  function dospec(field){

                      if(field.value == "0") {

                          _root.p_nspec.enabled = true;

                      } else {

                          _root.p_nspec.enabled = false;

                      }

                  }

                  </cfformitem>

       

                  <cfformgroup type="panel" label="Pipe Specification">

                      <cfselect name="p_cspec" onchange="dospec(this);" query="pipe_Spec" value="spec_id" display="spec_name" label="Specification :" size="1" width="70"  >

                          <option value = "0" >Other . . .</option>

                      </cfselect>

                      <cfinput name="p_nspec" label="Other Specification :" size="15" Enabled="False">

                  </cfformgroup>

      </cfform>

       

      is here anyone can help me ?

        • 1. Re: How to Enable/Disable form item, with changing on CFSELECT on FLASH type CFFORM.
          BKBK Adobe Community Professional & MVP

          <cfform name="pipe_add" action="kooft.cfm" format="flash"  method="post"  skin="haloorange" width="300" height="850">

          <cfformitem type="script" >

          function dospec(){                 

              if(p_cspec.value == 0) {

                  p_nspec._visible = false;

              }

              else {

                  p_nspec._visible = true;

              }

          }

          </cfformitem>

          <cfformgroup type="panel" label="Pipe Specification">

          <cfselect name="p_cspec" id="p_cspec"  onchange="dospec()" query="pipe_Spec" value="spec_id" display="spec_name" label="Specification :" size="1" width="70">

              <option value = "0" >Other . . .</option>

          </cfselect>

          <cfinput type="text" id="p_nspec" name="p_nspec" label="Other Specification :" size="15" Enabled="False">

          </cfformgroup>

          </cfform>