Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Guest
Feb 22, 2012 Feb 22, 2012

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 ?

TOPICS
Advanced techniques
700
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 26, 2012 Feb 26, 2012
LATEST

<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>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources