View Full Version : php: populating 3 listboxes
Richlife
March 29th, 2008, 01:37 PM
I was converting old asp files to php.
But I'm stuck at this point.
I'm looking for a triple combo listboxes where one has "book" the other "chapter" and the third "verse". The book is populated by a database table. Once book is selected then chapter is populated and then verse.
Any tutorial related to this?
kdd
March 30th, 2008, 01:39 PM
Depending on what is selected, I'd use ajax to send the name of the book selected, then use PHP to do database query stuff, and then use "book" AND "chapter" to select verse again using PHP to do database query stuff.
Tekime
March 30th, 2008, 04:16 PM
My first reaction is AJAX (Javascript & XMLHTTPRequest) to do what kdd described. If the list isn't huge you use Javascript without any AJAX methods by setting and filtering each list from values already loaded. The failsafe method (not requiring client-side scripting) would be either a form submit on each selection, or just a complete list grouped by book, chapter & verse where the user can select one option.
koolkrasher
March 31st, 2008, 12:43 AM
what if you did a mysql query and have it return an array with each of your above said topics then just assign the arrays to select fields would that do the trick?
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.