By: Ignacio
Date: 2005-03-30
Time: 22:06
|
2 selects dependents (combo) Javascript
how i do this! my from is argentina! bye! |
||
By: Skrol29
Date: 2005-03-31
Time: 17:07
|
Re: 2 selects dependents (combo) JavascriptHi Ignacio,
Your two select dependents can be done by two ways. First one is to use sub-blocks just like in the inline examples. This is the closer way from what you coded. But is seems to me that you can simplify your code using only one query with joinned tables. Your PHP can be something like this:
And you HTML side:
It won't work as is, because fields "gl" and "dl" are not defined. They cannot be provided by the query, so you have calculate them using a user function and parameter 'onsection', or to change you indexation if it's possible. |
||
By: Ignacio
Date: 2005-03-31
Time: 18:17
|
Re: 2 selects dependents (combo) JavascriptI do not understand much on this, you can show an example to me working on this subject? I pass some tools to you:
http://www.programacionweb.net/articulos/articulo/?num=269 http://www.desarrolloweb.com/articulos/1281.php |
||
By: Ignacio
Date: 2005-03-31
Time: 19:49
|
Re: 2 selects dependents (combo) Javascript |
||
By: Skrol29
Date: 2005-04-01
Time: 14:30
|
Re: 2 selects dependents (combo) JavascriptHi Ignacio,
I can give a solution for that problem explain on experts-exchange.com, because the two other links are not in english and I can't understand them. First you have to decide if the refine of sub-list are done by javascript (without refreshing the entire page), or by php (refreshing the entire page). If you do it by PHP, then it is simple for the merge, but you'll probably have to recall all other entries of the form. If you refine by Javascript, then it doesn't need to refresh the entire page, but the page needs to have all data of the tree tables in Javascript. That's perhaps a lot of data. And you have to code a specific script function to clear-and-feed the list. Here is an example with refine using PHP: HTML side:
PHP side:
|
||
By: Ignacio
Date: 2005-04-01
Time: 22:18
|
Re: 2 selects dependents (combo) Javascriptplease, i like to see an example me in operation on this using Javascript or if it does not exist alternative, that is in php. I need to arm something like selects of here:
http://www.ig2producciones.com.ar/clientes/30n/admin/formAgregarNovedades.php I need something that walks equal to that and it please takes the data me from the data base... and an example walking because I follow without understanding well as it is the operation. |
||
By: Skrol29
Date: 2005-04-02
Time: 02:04
|
Re: 2 selects dependents (combo) JavascriptOk, give me the MySql data, and I'll make and example.
|
||
By: Ignacio
Date: 2005-04-02
Time: 06:30
|
Re: 2 selects dependents (combo) Javascript |
||
By: Skrol29
Date: 2005-04-03
Time: 03:09
|
Re: 2 selects dependents (combo) JavascriptHere is an example that worls with your data:
PHP:
HTML:
|
||
By: Pirjo Posio
Date: 2005-04-03
Time: 14:25
|
Re: 2 selects dependents (combo) JavascriptThree times hip-hip-hooray! to Skrol29!!!
I also had the same problem, and this is the quickest way to solve it. If we also want to give the possibility to use this without JavaScript, then I suppose we should put your earlier solution above between [noscript] and [/noscript] tags - haven't tested yet. |
||
By: Ignacio
Date: 2005-04-03
Time: 20:11
|
Re: 2 selects dependents (combo) Javascriptjejejejejeje, yeah! i dont know english, but, thanks!!! its works!!
|
||
By: Ignacio
Date: 2005-04-03
Time: 22:45
|
Re: 2 selects dependents (combo) JavascriptSkrol29, its was excellent that script, worked perfect.
I am arming forms to add, to erase, and to modify registries of the data bases. In another data base, I keep the related registries that you did to me with <select>. Now i need in a form to modify (<select value="id" selected></select>), that appears id_pais and id_prov as "id" selected. He will be very complicated to make? Greetings. PD: sorry about my little english! |
||
By: Skrol29
Date: 2005-04-05
Time: 00:03
|
Re: 2 selects dependents (combo) Javascript>Now i need in a form to modify (<select value="id" selected></select>),
> that appears id_pais and id_prov as "id" selected. He will be very >complicated to make? I'm sorry, I don't think I understand what you mean. |
||
By: Ignacio
Date: 2005-04-05
Time: 00:09
|
Re: 2 selects dependents (combo) Javascriptnevermine! sorry about my english, i already did it! tankx anyway!
|
||
By: Martin
Date: 2005-04-20
Time: 21:18
|
Re: 2 selects dependents (combo) JavascriptI changed your code to work with a catergory and product select instead of the pias and prov selects. But my problem is that every time when the page is refreshed the second select list, in my case the product list, is empty. What I try to achieve is a to have the current selected items selected after a form submit
I added this to the php code:
This works for the first select (it stays selected). html
So every time when I submit the form, the product select only shows <select an item> with an empty list. Instead that the current item stays selected with the complete list. Can anyone give me a pointer what to change so that the second select maintains it's list and selection. Thanks in advance. |
||
By: Ignacio
Date: 2005-04-20
Time: 21:24
|
Re: 2 selects dependents (combo) Javascriptthis is with remote scripting?
|
||
By: Martin
Date: 2005-04-20
Time: 21:41
|
Re: 2 selects dependents (combo) JavascriptI'am not sure what you mean? This is with the latest example above made by Skroll. So this includes two selects, javascript and mysql.
|
||
By: Skrol29
Date: 2005-04-22
Time: 15:28
|
Re: 2 selects dependents (combo) JavascriptHello,
I've posted a new Tip & Trick about how to make 3 independent <select> list-boxes using JavaScript. Enjoy, |