I'm looking for some help converting this from prototype to jQuery. I'm doing some free work for a charity and updating a system they use to track and assign volunteers. I've managed to convert everything else so far, however, this has me stumped. Please excuse the spelling mistakes, the code is verbatim what I've been given.
I've had a look at http://docs.jquery.com/Ajax/jQuery.ajax but not been able to put everything together that covers all the different parts. Normally just end up with some sort of broken mess.
I have a page with lots of checkboxes, like this:
<input <?PHP echo $checked; ?> type='checkbox' onclick='toggle_advisor_assignment_mark("<?PHP echo $advisor['id']; ?>", "<?PHP echo x('case_id'); ?>");' />
When checked or unchecked (as the case may be), ajax is used to call the php which uses the advisor id and case id to assign or remove the advisor/volunteer, and it returns the output for a div (called adviors_box) to list the current advisors/volunteer.
The javascript code:
function toggle_advisor_assignment_mark(id, case_id)
{
new Ajax.Updater('adviors_box', 'index.php', {
evalScripts: true,
method: 'POST',
parameters: 'task=case_change_advisors&ajax_mode=yes&id='+id+'&case_id='+case_id
});
}
Thanks in advance for any help.