Xtremer360 Posted September 30, 2008 Share Posted September 30, 2008 Okay I have a table called shows and I have two types of shows called Weekly Show and PPV. Both types (option) are in a drop down select box. What I want to happen is when the user chooses Weekly Show it goes to the database shows table and looks under the type field and searches all the records with the types as Weekly Show and gathers their show names. and places those in another drop down select box. The same is done for the PPV in the same second drop down select box. And when one of those show names is selected then it goes back to the database show table and finds all the records with that showname and looks at the fields beside it in the table and finds the highest number and then adds 1 to the number and places that number in the input field The form is found at kansasoutlawwrestling.com/backstage/setupshow.php Quote Link to comment Share on other sites More sharing options...
F1Fan Posted September 30, 2008 Share Posted September 30, 2008 You need an onChange event added to the select boxes that call your JS function. Quote Link to comment Share on other sites More sharing options...
Xtremer360 Posted September 30, 2008 Author Share Posted September 30, 2008 Do you have a great JavaScript Function that I can use or know of where I can find a good one? Quote Link to comment Share on other sites More sharing options...
F1Fan Posted September 30, 2008 Share Posted September 30, 2008 Have you done any AJAX before? Your JS function would need to call PHP code that would return the options. Quote Link to comment Share on other sites More sharing options...
Xtremer360 Posted September 30, 2008 Author Share Posted September 30, 2008 I have not before. Quote Link to comment Share on other sites More sharing options...
F1Fan Posted October 1, 2008 Share Posted October 1, 2008 OK, if you have not used AJAX before, you'll need to learn it before something like this. It's not as simple as just throwing in a JS function that will do what you want. I'll give you an idea of how AJAX works. There are two ways that AJAX can work for you. The both start the same, by calling a JS function. That function will call a PHP file that you can pass variables to if you want. Then the two different ways are that the PHP file can either return HTML or JS code. If it returns HTML, you simply use the innerHTML tool to put that HTML where you want. If it returns JS, you use the JS eval() function to run that code. I suggest you go through some tutorials and learn how to use AJAX. Then if you still have trouble with what you're trying to do here, re-post and you'll get help. Without you learning at lease some AJAX, I won't be able to help you now without simply writing your program for you. 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.