change form button on submit
I am currently using a simple image to post an action to a php page. When the image is clicked the post does it's thing and the button image changes and the class changes to do the opposite when clicked again. It is a button to mark as favorite, unmark as favorite. I was hoping someone could help me apply the same to a form as I have another area that requires more data to be passed to the post. here is what I am using now. I would like the form button to change and the action of the form to change...almost exactly as my current example just passing more data. I think I could do the code if I knew how to reference the form's button and action.
Thanks for the help,
maddogandnoriko
JQUERY
-
$('.toggleRead').click(function(){
var $this = $(this);
$(this).iflip('images/buttons/plus.png','images/buttons/close.png');
if ($this.is('.unread')) {
$this.removeClass('unread').addClass('read');
//extract topic_id, to send with POST request
var $seriesid = $(this).attr('id').split('_');
//make the POST request
//return false;
} else if ($this.is('.read')) {
$this.removeClass('read').addClass('unread');
// do ajax call to mark as UNREAD.
}
});
IMAGE BUTTON
-
<img src="images/buttons/close.png" class="toggleRead read" id="seriesid_{$show_id}"/>