| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
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. |
|
|
|
|
|
#3 (permalink) |
|
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> </td> <td> </td> <td> </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> |
|
|
|
#5 (permalink) | |
|
Registered User
Join Date: Sep 2006
Location: Calgary
Posts: 7
|
The problem is with this line... Quote:
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 |
|
|
![]() |