Hello, I have DB of category (id, name) and DB of sub_category (id, category_id, name) I want to do select box for sub_category that will be changed according to the "category" box. I mean - if I'm choosing the second category I will see different options on the sub category box. Can you please help me with that?
What kind of help do you need, it is fairly straightforward. When the user changes the selection in the first select box invoke a javascript call to populate the second select box using AJAX.
I'm not sure if you can see that (because the lang type), but here: http://www.israeli-guitar.com/sites/sb/index.php?page=register the first select box effect on the second one. for some reason its only works on FF and not on IE (I have ver 6)... :/
Yes I can see the select boxes and yes I see that they are working in FF. I don't use IE so can't run a test on that, but as you said it's not working in IE6 for you I did a little digging based on that information. Looking over the source code of your web site, this isn't a PHP problem but rather a problem in jQuery. This isn't really my area of expertise as I tend to avoid libraries and custom develop stuff, but I did some searches for you and this is what I found. This guy, used the following code directly above his problem code and this got it working: if (!XMLHttpRequest) { window.XMLHttpRequest = function() { return new ActiveXObject('Microsoft.XMLHTTP'); } } Code (markup): This next guy also had the same problem, code not working in IE6 but in this case he is using the jQuery library. As I said, I don't use jQuery, but you might be able to read through that page and spot something which will get your code working. HTH
You'll need to invoke a JavaScript call to a script that contains details for the second select box. Some pseudo code for this below: User selects from select1 select1 value passed via JS to subselect.php subselect.php queries database for that value, and returns all options in <option value="">sub select value</option> format Your JS on the original page populates the select using innerHTML Code (markup): You can do this with just a couple of functions using a JS framework like JQuery
you may want to simply find a good tutorial to get the multibrowser portion working and then modify it to work with your specifics.
Mike, perhaps reading his second response and looking at the link he posted which shows he already has the two select boxes in place, using jQuery and they are working.... his problem is that they are not working in IE6.