Log in

View Full Version : fetching data in db on combobox



zodehala
02-18-2012, 08:31 AM
i am using following chained combo (like you know its values coming from js file)
http://www.dynamicdrive.com/dynamicindex16/chainedselects/index.htm

i am using this combo for my form. i can insert its value into mysql but when i edit any record

how can i select outomatically entry which is coming from db ?

fastsol1
02-18-2012, 03:13 PM
Combining the JS script with a db select is rather complicated. It's really better to just use a little jquery and a db that holds all of you selections. Actually I have a tutorial on this - http://phpacademy.org/forum/viewtopic.php?f=31&t=9840 Now in the tutorial I don't get into the concept of retaining the selection after a form post but I have done it on a couple of my sites. I don't really like to just give away code cause learning it is a better idea, but if you get stuck and can't figure out things you can post back or pm me and I will help where I can.