views:

357

answers:

1

I am attempting to make a registration-like page for a small forum. To register for an event, I simply want the users to click a 'link'. (It doesn't have to be a link, but I don't want it to look like a button, so fancy CSS is acceptable).

On this page there will be a limited number of openings per event. (Simple database query to populate this list). The users will then select one of the openings by clicking on it. At this point, I'd like that opening to close and the page NOT to reload (just the Div that link is in).

I know PHP/MySQL very well. Actually, DOING the insertion of the data is easy. What I don't know how to do is the clicking the link and not reloading the entire page but still showing that opening is now closed.

I've looked at jQuery. It seems to have the ability to do the autoreload. Can anyone help me out?

The insert in the DB will be the user's forum name (they are logged into the forum, I have access to that variable within my script). That is all that will get inserted into the database.

+1  A: 

Look at the Ajax methods. To update the database you probably must do a $.post. Something like this will work:

$("#myButtonId").click(function() {
  $.post(serverurl, $("myformId").serialize(), function() {
  // This will be called when the post is complete
  $("#mydivId").html('update html here');
  });
});
kgiannakakis