views:

212

answers:

1

Hi everyone, I'm trying to create a dependent select form like this one on AjaxRay. Here's what I've done so far: http://buzzmedia.com.my/honda/form.html

Unlike the example from AjaxRay, my form has multiple rows. I need to figure out how to adapt the code from the AjaxRay example for my own form.

+1  A: 

I think you would enjoy writing your own jQuery code... If number of options is limited (under ~500) Then I think you should put them in an array.. otherwise you should use AJAX to query it dynamically as JSON..

lets say they are limited number.. A hierarchy array like this should do it..

var ops = [
     {'txt':'Accord'
      ,'val':1
      ,'ops': [
               {'txt':'VTi','val':101}
              ,{'txt':'VTi 2.3','val':102}
              ,......
     ]}
     ,
     {'txt':'City'
       ,'val':2
       ,'ops':[
               {'txt':'1.5 i-DSI','val':201}
              ,{'txt':'1.5 Vtec','val':202}
              ,......
     ]}
     ,......
];

then you can populate all select boxes from that array.. and add on-change handler function on the parent box with the id of the child box.. ID's can be On change of the parent box you get $(this).val() and scan the array for it to populate the child box...

Hope that helps..

Mike More
wow Mike, thanks for that. I really appreciate you taking the time for figuring that out.check honda.com.my in 3 weeks to see it in action. cheers
You welcome, I will check it for sure..
Mike More