function execSearch (){ var url = "check_d_ajax.php"; var P_params = Form.serialize('s_d'); Ajax.Responders.register({ onCreate: showLoading }); var ajax = new Ajax.Request(url, { method: 'post', parameters: P_params, onComplete: procesaRespuesta, onFailure: getErrorreport } ); } function procesaRespuesta(resp){ if (resp.responseText == 'no') { $('result_w').innerHTML = "Dominio NO DISPONIBLE"; }else{ $('s_d').action = "dominios.php"; $('a_p').value = "1"; $('s_d').submit(); } } function showLoading(){ $('result_w').innerHTML = "Buscando..."; } function getErrorreport(request){//error ajax alert('Sorry. There was an Ajax error!.'+request); }