I need help to get submission of an RSVP with radio buttons like this:
Attending: <input type="radio" />
Maybe Attending: <input type="radio" />
Not Attending: <input type="radio" />
Whenever someone RSVP the event, it should ratio the input to the selected (so just one radio button can only be selected), so when one option is selected, it should do an AJAX request with the $.ajax
function.
I did this:
Attending: <input type="radio" onclick="rsvpEvent(3, 1);" />
Maybe Attending: <input type="radio" onclick="rsvpEvent(2, 1);" />
Not Attending: <input type="radio" onclick="rsvpEvent(1, 1);" />
With jQuery:
function rsvpEvent(rsvp, id)
{
$.ajax({
type: "GET",
url: "http://localhost:8888/update/test.php",
data: "rsvp=" + rsvp + "id=" + id,
success: function()
{
alert('rsvp: ' + rsvp + ' id: ' + id);
},
error: function()
{
alert('rsvp: ' + rsvp + ' id: ' + id);
}
});
}
That doesn't work at all... what is the problem?