sanjeevk Posted May 7, 2007 Share Posted May 7, 2007 hi i have a problem in displaying contents in a list box where each list box contents depend on the selection in another list box. i need to display all the districts in 2nd list box when a the first list box contents a particular zones. all the zones and districts are fetched from the database .. please can anyone help mme out ... Quote Link to comment Share on other sites More sharing options...
boo_lolly Posted May 7, 2007 Share Posted May 7, 2007 i did something very similar. http://www.phpfreaks.com/forums/index.php/topic,129192.msg540919.html#msg540919 Quote Link to comment Share on other sites More sharing options...
xenophobia Posted May 8, 2007 Share Posted May 8, 2007 You need AJAX for that. Or you can predefined all your variables to stores all your districts. Which means embed your php code inside your javascript. became myscript.js.php. Quote Link to comment Share on other sites More sharing options...
igor berger Posted May 8, 2007 Share Posted May 8, 2007 Maybe you can integrate this with iframe, so the user still sees the first drop down menu on the page, without refreshing the whole page! Or you can use the whole operation in an iframe. Or a little more advance, hide the second drop menu in a DOM method. Just variations for fancier implementations. Quote Link to comment Share on other sites More sharing options...
boo_lolly Posted May 8, 2007 Share Posted May 8, 2007 you don't need AJAX, nor do you need to use an iFrame. my post does exactly what he's looking for. exactly, except it's done in PHP, not javascript. Quote Link to comment Share on other sites More sharing options...
igor berger Posted May 8, 2007 Share Posted May 8, 2007 No problem! Your way is correct! php file post to a php file post to a php file! All I did is offer posting to php file in a iframe.....so you can leave the first list box on the page for your eyes only. It is just a user intarface.......you can probably convert the first form listbox to a table of what is selected using DOM or, just post the information to the php file and echo it, so the user can see what they selected........ These are just ideas for user interface.......which one is easy and simple to use.......it is probably your suggestion.......I am just offering variations of display........take it or leave it. Quote Link to comment Share on other sites More sharing options...
boo_lolly Posted May 8, 2007 Share Posted May 8, 2007 No problem! Your way is correct! php file post to a php file post to a php file! All I did is offer posting to php file in a iframe.....so you can leave the first list box on the page for your eyes only. It is just a user intarface.......you can probably convert the first form listbox to a table of what is selected using DOM or, just post the information to the php file and echo it, so the user can see what they selected........ These are just ideas for user interface.......which one is easy and simple to use.......it is probably your suggestion.......I am just offering variations of display........take it or leave it. agreed. there's always more than one way to write a program that skins cats. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.