/** * ajax 验证 */ function ajax4form(form_id,t){ (function($){ if (form_id!=''){ var D = $('#'+form_id).serialize(); var S = $('#'+form_id+' input[type=submit]').val(); $('#'+form_id+' input[type=submit],button').val('处理中...').attr('disabled',true); } $.ajax({ type:'post', url:'/ajax.php', data:'t='+t+'&'+D, dataType:'json', success:function(R){ $('#'+form_id+' input[type=submit],button').val(S).attr('disabled',false); if (R.erro!=0){ alert(R.msg); $('#'+form_id+' input[name='+R.name+'],#'+form_id+' textarea[name='+R.name+']').focus().select(); if(R.erro == 'yanzhengma'){ $('#yanzhengma').click(); } }else{ if (R.alert != '' && R.alert != undefined){ alert(R.alert); } if (R.sourse != '' && R.sourse != undefined){ eval(R.sourse); } $('#'+form_id+' input[rel*=clear],#'+form_id+' textarea[rel*=clear]').val(''); if (R.complete!='' && R.complete != undefined){ eval(R.complete); } if (R.url!='' && R.url != undefined){ window.location.href=R.url; } } if (R.createSendMailXmlFileName != '' && R.createSendMailXmlFileName != undefined){ var mailOptin = { 'debug':0, 'goUrl':R.goUrl, 'createSendMailXmlFileName':R.createSendMailXmlFileName, 'complete':R.mailComplete }; getMailHandle(mailOptin); } } }) })(jQuery) }


快速订房
预订热线:
最新优惠