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
messageSmarty 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.

messageRe: Smarty and Linked Select Boxes
Posted by: panos (IP Logged)
Date: June 21, 2007 01:48PM

Hi Fred,

i need little more info about it.
Do you get any javascript errors?
Can you copy them here?

If not the next issue is, does ajax handling script is in correct path?

Regards,
Panos

messageRe: Smarty and Linked Select Boxes
Posted by: d3f (IP Logged)
Date: June 21, 2007 01:58PM

Hi panos,

I dont get any js errors. Checked also with mozilla error console.

And seems that ajax handling script is in correct path.

Regards,
Fred

messageRe: Smarty and Linked Select Boxes
Posted by: d3f (IP Logged)
Date: June 21, 2007 02:02PM

I copyed from source the ajax and js output:

[pastebin.com]

messageRe: Smarty and Linked Select Boxes
Posted by: panos (IP Logged)
Date: June 21, 2007 02:03PM

can you give me url to see it?

messageRe: Smarty and Linked Select Boxes
Posted by: panos (IP Logged)
Date: June 21, 2007 02:06PM

url of working site (or mail it to panos@salix.gr)

messageRe: Smarty and Linked Select Boxes
Posted by: d3f (IP Logged)
Date: June 21, 2007 02:23PM

I sent you email smiling smiley

messageRe: Smarty and Linked Select Boxes
Posted by: panos (IP Logged)
Date: June 21, 2007 02:45PM

me too smiling smiley

messageRe: Smarty and Linked Select Boxes
Posted by: d3f (IP Logged)
Date: June 21, 2007 02:50PM

Haven't got any reply yet.

messageRe: Smarty and Linked Select Boxes
Posted by: panos (IP Logged)
Date: June 21, 2007 02:57PM

I resend it sad smiley

messageRe: Smarty and Linked Select Boxes
Posted by: d3f (IP Logged)
Date: June 21, 2007 03:02PM

Problem solved.

I missed sc_select_ajax_handler.php.

Thank you Panos very much!

Cheers! smiling smiley

messageRe: Smarty and Linked Select Boxes
Posted by: panos (IP Logged)
Date: June 21, 2007 03:08PM

My greetings to beautiful Baltic!
never been there but i love the landscapes i 've seen in tv.

Cheers!
Panos

messageRe: Smarty and Linked Select Boxes
Posted by: panos (IP Logged)
Date: June 21, 2007 03:57PM

Dont know if you got my mail yet, but look at [forum.salix.gr]



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