1

What I'm thinking of actually is the following: I want to have a drop-down displayed, after which I select some option, I want to run a Php that generates the options (by SQL) for a second drop-down that will appear after the first.

2
  • 2
    you can achieve this by using ajax
    – Code Prank
    Mar 1, 2012 at 12:05
  • it's all about simple ajax functionality my friend. Mar 1, 2012 at 12:06

3 Answers 3

4

You could use jquery's load method which will fetch the results returned by php which in this case would be some html markup and display it in whatever div.

$('#container').load( 'phpsript.php' );
0

You can use Ajax to call php script with selected option that would return a list of available options for second dropdown. You can either use JSON or XML for returning the data.

You can find an example here or here

0

if you want it like from the selection of first dropbox, second drop box should be dynamically generated, you should go for ajax or jquery ajax.

refer this like .. this will help you.. http://www.w3schools.com/ajax/tryit.asp?filename=tryajax_database

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.