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

java script: show hide text boxes based on dropdown selections

New Here ,
Jun 03, 2007 Jun 03, 2007

Copy link to clipboard

Copied

i wish to show/appear and dissappear text box based on a the drop down item selected.

under Comm_DEV
drop down selection.

if CELL_Phone then CELL_Phone text box shows/appears
if pager_device then CELL_Phone text box dissappears.

if email_Address only is selected then pager_device and CELL_Phone dissappears otherwise JOB_email_Address is shown ( even if CELL_Phone or pager_device is selected JOB_email_Address still appears)

Thank you
n
thanks in Adv
<!---------------------------------------------->
the field Comm_DEV gets populated with "E","CE","PE" when it is submit
when selected from the drop down.
<table>
<tr>
<td>Comm_DEV </td>
<td>
<SELECT name="Comm_DEV" size="1">
<OPTION Value = "EM">Please Select</OPTION>
<OPTION Value = "CE" <cfif Comm_DEV is "CE">selected</cfif>>CELL_Phone</OPTION>
<OPTION Value = "EM" <cfif Comm_DEV is "EM">selected</cfif>>email_Address Only</OPTION>
<OPTION Value = "PE" <cfif Comm_DEV is "PE">selected</cfif>>pager_device</OPTION>
</select> <!--------------------------></td>
</tr>
<!------Here are the text boxes to appear or dissapear CELL_Phone and JOB_email_Address-------------------->
<tr>
<td>CELL_Phone</td>
<td><cfoutput>
<cfif NOT len(trim(device_email_Address))><cfset device_email_Address = "@cingularme.com"></cfif>
<input type="Text" name="Device_email_Address" value="#Device_email_Address#" size="40" maxlength="40"> </td>




<td>
<b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">JOBemail_Address</font></b><br>
<cfif not len(trim(JOB_email_Address))><cfset JOB_email_Address = "@balbal.org"></cfif>
<input type="text" name="JOB_email_Address" Value="#JOB_email_Address#" size="40"><br><br>
</cfoutput></td>
</tr>


</table>
TOPICS
Advanced techniques

Views

472

Translate

Translate

Report

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
LEGEND ,
Jun 03, 2007 Jun 03, 2007

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

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
New Here ,
Jun 03, 2007 Jun 03, 2007

Copy link to clipboard

Copied

you can do this easy with some javascript

define an id on a <tr> like <tr id="checkbox1" ><td><checkbox ... etc.

you put on your select dropdown: onchange=hideFunction()

then you create a javascript that can hide this <tr> based on the dropdown values
something like
document.getElementById('checkbox1').style.display = 'block';
or
document.getElementById('checkbox1').style.display = 'none';



Votes

Translate

Translate

Report

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
New Here ,
Jun 08, 2007 Jun 08, 2007

Copy link to clipboard

Copied

LATEST
sorry.
Where/what do i put this in the code?


Thanks

Votes

Translate

Translate

Report

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
Documentation