Open Source & Stuff  
  |     Main Site     |      Forum     |     Contact     |
Ajax Linked Select boxes :  forum.Salix.gr forum.Salix.gr
Comments, questions, usage, bugs. 
Goto Thread: PreviousNext
Goto: Forum ListMessage ListNew TopicSearchLog In
messageLists Too Many Details
Posted by: greenday (IP Logged)
Date: October 15, 2008 12:09AM

Hi

Please could you look at my site:

[www.bestbnb.co.nz]

You see on the left hand side under Search Directory is are 4 select menus. Forget the first one, underneath this are three linked select boxes in this order:

North & South Island
All Regions
All Towns / Cities

First time, look in the 'All Regions' or 'All Towns / Cities' menus - but DONT select one, and you will see a huge list of all islands, regions and cities.

This is wrong, because you can choose a Town from the regions list, or a region from the towns list.

Can anyone see what i may have done wrong?

Here is my code:

<script type="text/javascript" src="scripts/prototype.js"></script>
<?php
include("top_script.php");
include("sc_classes.php");
$sc_ajax_select_boxes = new sc_ajax_select_boxes();
$sc_ajax_select_boxes->add_select_box('areas','rec_id','descr','rec_id',0,'island','island','', 'parent_id=0','North &amp; South Island');
$sc_ajax_select_boxes->add_select_box('areas','rec_id','descr','rec_id',0,'region','region','','','All Regions');
$sc_ajax_select_boxes->add_select_box('areas','rec_id','descr','rec_id',0,'town','town','','','All Towns / Cities');
$sc_ajax_select_boxes->link_select_boxes('island','region', 'parent_id',0);
$sc_ajax_select_boxes->link_select_boxes('region','town', 'parent_id',0);
$sc_ajax_select_boxes->place_jscripts();
$sc_ajax_select_boxes->show_select_box('island');
$sc_ajax_select_boxes->show_select_box('region');
$sc_ajax_select_boxes->show_select_box('town');?>
</div>

<div><label for="keyword" class="regLabel">Keyword search:</label><input type="text" name="keyword" id="keyword" /></div>

<div><input type="submit" class="introsearch_button" value="" name="submit"/></div>
</form>

Many thanks

messageRe: Lists Too Many Details
Posted by: panos (IP Logged)
Date: October 23, 2008 07:00AM

Hi,

you are the first one reporting that.
For some reasson
if( (!empty($link_field)) && (!empty($link_field_value)) ) {
takes 0 for empty value. Can you please give it a try setting '0' instead of 0 to the link_select_boxes calls:

$sc_ajax_select_boxes->link_select_boxes('island','region', 'parent_id','0');
$sc_ajax_select_boxes->link_select_boxes('region','town', 'parent_id','0');

Pls give me feedback on the results.
Hope it helps and sorry for the late response.

Best regards
Panos

messageRe: Lists Too Many Details
Posted by: greenday (IP Logged)
Date: October 23, 2008 05:03PM

Hi Panos,

Thanks for your reply.

I tried your suggestion, but unfortunetly it didnt work.

What is strange is, if you select the parent box (North & South Island) and select any island, and then change that box back to the default 'North & South Island', the child selectors cant be selected, and that is how it should be on page load.

Could it be something with the onchange function?

Thanks for looking at my problem,
Phil



Sorry, only registered users may post in this forum.

All Rights Reserved 2006 Salix.gr  |  Design by Ades Design |  Hosting by e-emporio |  forum.Salix.gr powered by Phorum