jdgower Posted March 11, 2010 Share Posted March 11, 2010 I am not sure if this is in the write forum, I apologize if it's not - I assume it could deal with php, html, ajax, mysql or probably all 4... I am trying to create a form that is like this: I have 3 mysql databases progressive statefarm encompass I want to create a form that asks first for something like "what kind of car do you drive?"...now let's say you select 'pontiac sunfire' from the drop down (which is populated by a master list of all models from every database) and I dont have a 'pontiac sunfire' listed under 'models' in the statefarm database...I would then like a dropdown to appear below saying that statefarm doesn't have that model listed, please select a model below and then have it give all the models on just the statefarm database. Please point me in the right direction or even let me know if it's possible - would i instead have to create a page that the user goes to when they hit submit? Thank you in advance, Jeremy Quote Link to comment Share on other sites More sharing options...
beta0x64 Posted March 14, 2010 Share Posted March 14, 2010 I do not understand. If it doesn't have the model for State Farm, then is it an option for the select? I'm really not sure what you're trying to do. As far as making it appear or even adding it to the page/DOM (and even the MySQL database), of course you can. You might need jQuery LiveQuery, though, unless you want to make the select box hidden on the page. It's really up to exactly how you want to do this. Generally, have jQuery, through AJAX, send the selected option as a parameter to the PHP page (maybe some kind of session token to prevent abuse here?), then have PHP check the MySQL. Use the callback to read the output from the php page. If you want to make the select box's options dynamic, then you'll need to build it with PHP that checks the MySQL, put it through the callback, then add it to the DOM with jQuery. You will need LiveQuery if you do it that way. Hope I helped! 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.