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
messageSelected Item
Posted by: casic (IP Logged)
Date: October 04, 2007 03:14PM

Hi , Panos
This is a good script but i can't found the way how to use that wit option selected .
I want to use this script with CakePHP form validation , and when all fields in form are validated , this 2 select boxes (example sel1- Countrys, Sel2 - States /Provinces ) are reseted , and i want to show previos selected item .
Is there any way to do that.
Thanks in advance.
Best Regards
Kostadin

messageRe: Selected Item
Posted by: panos (IP Logged)
Date: October 04, 2007 03:55PM

Hi Kostadin,

If i get right what you try to do.

There is a tricky point there, i should do a fix someday smiling smiley
when you want to show selected value you have to


$sc_ajax_select_boxes->add_select_box(
'lsd_demo_2','rec_id','descr','rec_id',2, <----- selected value for first box
'sel1','sel_id_1','', 'parent_id=0');

$sc_ajax_select_boxes->add_radio_box(
'lsd_demo_2','rec_id','descr','rec_id',10, <------- selected value for second box
'sel2','sel_id_2','');

and when linking the two boxes you must set again selected value for first box

$sc_ajax_select_boxes->link_select_boxes(
'sel1','sel2', 'parent_id',
2); <-------------------------------selected value for first box


I know its crazy... but this way it will work.

So as far as i know CakePHP, form is in the view and controler/model validates and if not validated
view is shown again, right?
In form there is $data array... i stop here before i say somthing wrong...
you know CakePHP better

But still i would like to see some Cake code using this class smiling smiley

Regards
Panos

messageRe: Selected Item
Posted by: casic (IP Logged)
Date: October 04, 2007 06:15PM

Hi Panos,
I have already found the right way with many probes. Yes exact like your example , it is work. Thanks any way.

[www.mvpower.net]

CakePHP Form with your script . Don't Mind the Flash header i still working ot it.

Best regards

messageRe: Selected Item
Posted by: panos (IP Logged)
Date: October 05, 2007 08:55AM

Thanks



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