I am creating an admin backend for a site.
This admin backend will add instructors.
I need to have the ability to assign the instructors to several categories. So far easY? Multiple select field.
Here is where i am stuck.
I need a nice way of adding new categories on the fly without refreshing entire page.
Anyone know of any ajax, jqueryui or tutorial on how to accomplish this using PHP/MYSQL values that populate the categories field?
So you're looking at this from the Admin user's POV.
The user is looking at an Instructor Edit page.
You have a multiple select field (box).
You need to add a new item to the select field box. So you need a separate form/lone input box with a button next to it that says "Add Category".
Server takes in Category Name, spits out Category ID and Name again.
AJAX handler processes return, appends element to the list.
1: Forming the AJAX request
2: The PHP to receive the AJAX request and return the reponse
3: The line of jQuery needed to add the category to the box
Show us what you've done, and we can try and point you in the right direction.
Thanks for your response.
Im having an issue with all 3.
I am not good with AJAX, so I was looking to see if anyone knew of a solution that exists with documentation on how to install.
Basic AJAX example: http://www.w3schools.com/ajax/tryit.asp?filename=tryajax_first
Basic AJAX tutorial: http://www.w3schools.com/ajax/default.asp
(This covers #1; #2 you should be able to do)
jQuery to append a category to a multi-select: $("#catSelect").append('<option value="1">My option</option>');
This topic is now closed. New replies are no longer allowed.