I have this bit of JQuery
function saveLocation_save_changes() {
alert("aa");
alert($('#post_id').val());
alert($('#website').val());
$('.gmw-yl-tab').removeClass('active');
$('#gmw-yl-address-tab').addClass('active');
$('.gmw-yl-tab-wrapper').hide();
$('#gmw-yl-address-tab-wrapper').show();
$("#gmw-yl-spinner").show();
$('#gmw-yl-get-latlng, #gmw-yl-get-address').removeClass('changed');
if ( $('#gmw-yl-update-location').hasClass('update') ) {
$('#gmw-yl-form').slideToggle();
}
$('#gmw-yl-update-location').removeClass('update');
var args = {};
$.ajax({
type : "post",
data : {action:'gmw_f2_update_listing_location', 'post_id': $('#post_id').val(), 'post_type': $('#post_type').val(), 'post_title': $('#post_title').val(), 'address': $('#gmw-yl-autocomplete').val(), 'phone': $('#phone').val(), 'alternative_phone': $('#alternative_phone').val(), 'email': $('#email').val(), 'website': $('#website').val()},
url : ajaxurl,
error:function(data){
alert(data);
alert("ddd");
},
success:function(data){
alert("bb");
setTimeout(function() {
$("#gmw-yl-spinner").hide();
$("#gmw-yl-message p").html(data);
$("#gmw-yl-message").fadeToggle(function(){
setTimeout(function() {
$("#gmw-yl-message").fadeToggle();
},2500);
});
},500);
alert("qq");
$("#dr_update_form").submit();
alert("rr");
}
});
alert("cc");
return false;
};
Called by
$('#save_changes').click(function() {
return saveLocation_save_changes();
});
When I click on "Save Changes" on the update-listing page gmw_f2_update_listing_location work OK and the location, phone etc gets stored in the database but the Practice Name, fee etc doesn't when $("#dr_update_form").submit(); is called. I suspect add_action( 'template_redirect', array( &$this, 'handle_page_requests' ) ); isn't being actioned but I don't know what I need instead. Thanks