i wish to show/appear and dissappear text box based on a the drop down item selected.
what do i have to add?
thanks
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>
4 2461
i wish to show/appear and dissappear text box based on a the drop down item selected.
what do i have to add to this code below?
DIV?
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>
i wish to show/appear and dissappear text box based on a the drop down item selected.
what do i have to add to this code below?
DIV?
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>
if you have an element with id called 'hideMe'', you can hide it using the code -
-
document.getElementById("hideMe").style.display = 'none';
-
Now go for it and post if you get any problems.
gits 5,390
Expert Mod 4TB
hi ... try to play with the following:
[HTML]
<script type="text/javascript">
// this function gets the selected VALUE and matches it with the start
// of the ids of a span-element that contains the label and inputfield
function toggle_box_display(val) {
var box_container = document.getElementById('input_boxes');
var box_list = box_container.getElementsByTagName('span');
var re = new RegExp('^' + val);
for (var i = 0; i < box_list.length; i++) {
var item = box_list[i];
item.style.display = re.test(item.id) ? 'block' : 'none';
}
}
</script>
<table>
<tr>
<td>Comm_DEV
<select name="Comm_DEV" size="1" onchange="toggle_box_display(this.options[this.selectedIndex].value)">
<option value = "_" selected>Please Select</option>
<option value = "CE">CELL_Phone</option>
<option value = "EM">email_Address Only</option>
<option value = "PE">pager_device</option>
</select>
</td>
</tr>
<!------Here are the text boxes to appear or dissapear CELL_Phone and JOB_email_Address-------------------->
<tr id="input_boxes">
<td>
<cfoutput>
<cfif NOT len(trim(device_email_Address))><cfset device_email_Address = "@cingularme.com"></cfif>
<span id="CE_cell_phone" style="display: none;">
CELL_Phone
<input type="Text" name="Device_email_Address" value="#Device_email_Address#" size="40" maxlength="40">
</span>
<span id="EM_job_email" style="display: none;">
<b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">JOBemail_Address</font></b>
<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>
</span>
</cfoutput>
</td>
</tr>
</table>
[/HTML]
i slightly had to adapt your html-layout for our purpose ... because its not good to use a table-layout here ... you would always show the fields in there cols and i think you probably will like the changed layout ... that shows the fields at ONE place ... if you need the table then you should adapt the code for you ;)
hope this helps ... and kind regards
You posted one thread in the Coldfusion forum, but you also posted here in the Javascript forum. I've merged the two threads.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Matthew Louden |
last post by:
if the user select the EmployeeID in drop down list, and then click the
submit button, and it will look up database and show the Employee Name in
the text box, this is easy.
But my case is:...
|
by: Steve Speirs |
last post by:
Hi
I'm trying to show/hide a simple piece of text and a text field on a
form based on what choice is made from a drop down box.
<select name="dropdown" size="1">
<option selected...
|
by: ehm |
last post by:
I apologize in advance for the cross-post (from
microsoft.public.inetexplorer.scripting), but that board seems dead.
I have what I think is a fairly simple problem, but I cannot figure
this out....
|
by: bonehead |
last post by:
I am a javascript newbie and did not see anything quite like this in
sections 1-5 of the FAQ or on a Google search.
Is there a generic javascript example of a compound drop-down/text box,
i.e.,...
|
by: Dan |
last post by:
Can anyone offer suggestions on how to do this or if it is possible?
I have a form that uses a drop down box and 2 text fields.
What I am trying to do is have the value of each text box set by...
|
by: uthooker |
last post by:
I have an Access form with some combo boxes in the Form Header that are
enabled/disabled using conditional formatting based on the setting in a
checkbox also in the Header (Combo box = Enabled by...
|
by: gubbachchi |
last post by:
Hi,
How can I get the selected item of the drop down box into a php variable in the same page. The options in drop down box are A,B and C and the code is here
<select>
<option value="Item...
|
by: yasminussain |
last post by:
Hi to all,
I have written one jsp file. In that file, I have one drop down which contains list of request name (like student name) based on the selected value within drop down I will display the...
|
by: jerrydigital |
last post by:
good evening,
I am trying to allow my users to enter in text if they don't find their option on my drop down menu. In the code below, I can get a text box to show up when I select 'Other' on the...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: Mushico |
last post by:
How to calculate date of retirement from date of birth
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: tracyyun |
last post by:
Hello everyone,
I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: Teri B |
last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course.
0ne-to-many. One course many roles.
Then I created a report based on the Course form and...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
| |