
Smarty and Linked Select Boxes
Posted by:
d3f (IP Logged)
Date: June 21, 2007 11:27AM
Hello,
The code i use in PHP file is following:
$sAjax = new sc_ajax_select_boxes();
$sAjax->add_select_box('bt_dbh_country','id','country_name','orderBy','','country','sID_1','style="width:200px"','',' - select - ');
$sAjax->add_select_box('bt_dbh_city','id','city_name','orderBy','','city','sID_2','style="width:200px"','',' - select - ');
$sAjax->add_select_box('bt_dbh_hotel','id','hotel_name','orderBy','','hotel','sID_3','style="width:200px"','',' - select - ');
$sAjax->link_select_boxes('country','city', 'country_id','country_id');
$sAjax->link_select_boxes('city','hotel', 'city_id','city_id');
$s->assign_by_ref('sAjax', $sAjax);
And in the Smarty TPL:
{$sAjax->place_jscripts()}
{$sAjax->show_select_box('country')}
{$sAjax->show_select_box('city')}
{$sAjax->show_select_box('hotel')}
The problem is, that when going to website "country" select box has values and other has "select" value and when select "country" child select box value blinks for 0.1 sec with value "please wait" and no value will come to that select box.
I tried the same plain code without smarty like in example and it worked fine.
Actually i think the problem is with linking, when i remove linking all boxes have values.
Any suggestions?
Regards,
Fred
Edited 1 time(s). Last edit at 06/21/2007 12:54PM by d3f.