<div class="bdbox">
<ul>
<li><span class="bdl"><em>*</em>企业名称:</span> <span class="bdr"><input id="companynames" name="companyname" size="30" class="txt" /></span></li>
<li><span class="bdl"><em>*</em>企业网址:</span> <span class="bdr"><input id="companyurls" name="companyurl" size="30" class="txt" /></span></li>
<li><span class="bdl"><em>*</em>您的称呼:</span> <span class="bdr"><input id="names" name="name" size="30" class="txt" /></span></li>
<li><span class="bdl"><em>*</em>您的手机:</span> <span class="bdr"><input id="phones" name="phone" size="30" class="txt" /></span></li>
<li class="gaob"><span class="bdl"> 备注留言:</span><span class="bdr"><textarea id="notes" name="note" rows="3" cols="26" onfocus="if(value=='请填写您想说的其他内容!') {value=''}" onblur="if (value ==''){value='请填写您想说的其他内容!'}">请填写您想说的其他内容!</textarea></span></li>
<li class="gaoc">
<input id="wfsubmits" type="image" src="__PUBLIC__/images/lijishenqing.jpg"
onclick="customerAdds()" name="wfsubmits" value="" class="send" />
<input type="hidden" value="" name="web_ref" id="web_ref" />
</li>
</ul>
</div>
<script type="text/javascript">
function customerAdds(){
$("#wfsubmits").attr('disabled','disabled');
var companyname=$("#companynames").val();
var companyurl=$("#companyurls").val();
var name=$("#names").val();
var phone=$("#phones").val();
var note=$("#notes").val();
if(companyname == ''){
ui.error("企业名称不能为空!");
$("#wfsubmits").removeAttr('disabled');
return false;
}
if(name == ''){
ui.error("您的称呼不能为空!");
$("#wfsubmits").removeAttr('disabled');
return false;
}
if(phone == ''){
ui.error("手机号码不能为空!");
$("#wfsubmits").removeAttr('disabled');
return false;
}else if(isPhone(phone)==false){
ui.error("手机号码格式不正确!");
$("#wfsubmits").removeAttr('disabled');
return false;
}
$.post("{:U('Home/Index/ajaxAddCustomer')}",{companyname:companyname,companyurl:companyurl,name:name,phone:phone,note:note},function(res){
if(res>0) {
$("#companynames").val('');
$("#companyurls").val('');
$("#names").val('');
$("#phones").val('');
$("#notes").val('');
ui.success('提交成功');
}else {
ui.error('提交失败');
}
$("#wfsubmits").removeAttr('disabled');
});
}
function isPhone(str){
var re=/^((\(\d{3}\))|(\d{3}\-))?13[0-9]\d{8}?$|15[0-9]\d{8}?$|18[0-9]\d{8}?$/;
if (re.test(str) != true) {
return false;
}else{
return true;
}
}
</script>
|