Old 12-10-2006, 09:31   #1 (permalink)
phoenix211984
Registered User
 
Join Date: Sep 2006
Posts: 3
Hide/Show Layer Help

I have a PHP web page designed in dreamweaver mx 2004 that has 5 dependant dropdown menus.(from mx widgets extension) that get data from a mysql database.

The dependant dropdowns are:
Make
Model
Spec
Job
Area

The job section has a list of Clutch, brakes, full service and so on. Upon selecting Brakes from the JOB menu i have a hidden layer multiple selection field that should show with four options that the user can choose from such as (Rear Brakes, Front Brakes and so on)

My problem is that i want the multiple selection field hidden unless the user selects BRAKES from the JOB dropdown. At the moment it is showing when any job is chosen.

I would be grateful for any help. Thanks in advance.
  Reply With Quote
Old 12-10-2006, 09:37   #2 (permalink)
mx
fucksocks™
 
mx's Avatar
 
Join Date: Jun 2005
Location: in the boosh
Posts: 1,622
post some code maybe...
__________________
  Reply With Quote
Old 12-10-2006, 09:58   #3 (permalink)
phoenix211984
Registered User
 
Join Date: Sep 2006
Posts: 3
This is where i am having the problem (i think)


<td height="33">Job:</td>
<td><select name="job" id="job" onChange="MM_showHideLayers('Layer1','','show')">
<option value="value"><--Please Select---></option>
<?php
do {
?>
<option value="<?php echo $row_rsJobs['job_id']?>"><?php echo $row_rsJobs['job_name']?></option>
<?php
} while ($row_rsJobs = mysql_fetch_assoc($rsJobs));
$rows = mysql_num_rows($rsJobs);
if($rows > 0) {
mysql_data_seek($rsJobs, 0);
$row_rsJobs = mysql_fetch_assoc($rsJobs);
}
?>
</select></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><div id="Layer1" style="position:absolute; width:200px; height:28px; z-index:1; left: 312px; top: 170px; visibility: hidden;">
<select name="select" size="4" multiple>
<option value="1" selected>Front Brake Discs</option>
<option value="2">Rear Brake Discs</option>
<option value="3">Front Brake Pads</option>
<option value="4">Rear Brake Pads</option>
</select>
</div></td>
  Reply With Quote
Old 12-10-2006, 10:15   #4 (permalink)
mx
fucksocks™
 
mx's Avatar
 
Join Date: Jun 2005
Location: in the boosh
Posts: 1,622
try display:none;
__________________
  Reply With Quote
Old 12-10-2006, 10:55   #5 (permalink)
RJP
Registered User
 
RJP's Avatar
 
Join Date: Sep 2006
Location: Calgary
Posts: 7
The problem is with this line...

Quote:
<select name="job" id="job" onChange="MM_showHideLayers('Layer1','','show')">

As it is, the command to show the pop-up is run whenever that select field is changed, no matter what it is changed to. You need to change the javascript so that it only runs the "show" command if the value is brakes, and you also need to hide the layer again if it's chnaged to something not brakes.

(the following code is untested)

<select name="job" id="job" onChange="if (this.value == 'brake_id') { MM_showHideLayers('Layer1','','show'); } else { MM_showHideLayers('Layer1','','hide'); }">

You replace "brake_id" with the id number of the brake job.

-Ryan
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8