

/*
Part of the code for the article "Use Ajax and PHP to Build Your Mailing List"
by Aarron Walter (aarron@aarronwalter.com)
http://www.sitepoint.com/article/use-ajax-php-build-mailing-list
*/
//alert('here is the update script');
// Attach handler to window load event
Event.observe(window, 'load', init, false);

function init() 
{
 
  // Attach handler to form's submit event
  Event.observe('contactForm', 'submit', UpdateUser);
}


function UpdateUser(e) 
{




$('feedback').innerHTML = '<img src=\"../../images/loading_indicator.gif\"  />';
   
var pars = 'bus_id=' +escape($F('bus_id')) +'&wpuser_id=' +escape($F('wpuser_id')) +'&bus_name=' +escape($F('name')) + '&bus_address=' + escape($F('address')) +'&bus_phone=' +escape($F('phone')) +'&bus_email=' +escape($F('email')) +'&bus_url=' +escape($F('url')) +'&bus_description=' + escape($F('description')) +'&bus_html=' +escape($F('html')) +'&bus_cat=' +$F($("contactForm").category)  ;
//var pars = 'bus_name=' +escape($F('name')) + '&bus_address=' + escape($F('address'))   ;


//alert('post query ' +pars);



$('feedback').innerHTML = 'Your Listing Is Updated';

var myAjax = new Ajax.Updater('feedback', '../../process_business_edit_form.php', {method: 'get', parameters: pars});
Event.stop(e);
// Jump top this page .. http://metropomona.com/newsite/business-listing-return/?business_id=5  where 5 is the business id
}//


/*
function storeOptional(e) 
{


var pars = 'first_name=' + escape($F('first_name')) + '&last_name=' + escape($F('last_name')) + '&address=' + escape($F('address')) + '&city=' + escape($F('city')) + '&state=' + escape($F('state')) + '&zip=' + escape($F('zip')) + '&best_time=' + escape($F('best_time')) + '&how_soon=' + escape($F('how_soon')) + '&phone=' + escape($F('phone')) + '&last_id=' + escape($F('last_id'));
alert('store Optional');
$('response').innerHTML = 'Submitting message ..';

var myAjax = new Ajax.Updater('response', 'put_SignUpFormOptional.php', {method: 'get', parameters: pars});
Event.stop(e);
}
*///
