@ -53,7 +53,7 @@
< div class = "col-xs-12 col-sm-12 col-md-12 wrap" >
< div class = "col-xs-12 col-sm-12 col-md-12 wrap" >
<!-- form -->
<!-- form -->
< form id = "my form" name = "my form" class = "form-horizontal wow fadeInDown" >
< form id = "form" name = "form" class = "form-horizontal wow fadeInDown" >
< div class = "form-group" >
< div class = "form-group" >
< label for = "title" class = "col-sm-3 control-label left" > 融资公司:< / label >
< label for = "title" class = "col-sm-3 control-label left" > 融资公司:< / label >
< div class = "col-sm-6" >
< div class = "col-sm-6" >
@ -105,19 +105,22 @@
< div class = "form-group" >
< div class = "form-group" >
< label for = "code" class = "col-xs-12 col-sm-3 control-label left" > 上传商业计划书:< / label >
< label for = "code" class = "col-xs-12 col-sm-3 control-label left" > 上传商业计划书:< / label >
< div class = "col-xs-7 col-sm-4 pic-show" >
<!-- <div class="col - xs - 7 col - sm - 4 pic - show"> -->
< input type = "text" name = "prospectus" class = "form-control right" id = "prospectus" placeholder = "" >
<!-- <input type="text" name="prospectus" class="form - control right" id="prospectus" placeholder=""> -->
< / div >
<!-- </div> -->
< div class = "col-xs-4 col-sm-4 col-md-2 pic-pic" >
<!-- <div class="col - xs - 4 col - sm - 4 col - md - 2 pic - pic"> -->
< button class = "btn btn-danger page-btn" > 上传< / button >
<!-- <button class="btn btn - danger page - btn">上传</button> -->
<!-- <button class="">上传</button> -->
< input type = "file" name = "prospectus" >
<!-- </div> -->
< / div >
< div class = "form-group" >
< div class = "col-sm-offset-4 col-sm-12 sub" >
< input class = "button" type = "button" onclick = "apply()" value = "提交申请" >
< / div >
< / div >
< / div >
< / div >
< / form >
< / form >
< div class = "form-group" >
< div class = "col-sm-offset-4 col-sm-12 sub" >
< button type = "submit" name = "button" value = "提交申请" id = "submit" class = "btn btn-danger page-btn" > 提交申请< / button >
< / div >
< / div >
< / div >
< / div >
@ -133,82 +136,70 @@
< SCRIPT language = javaScript >
< SCRIPT language = javaScript >
$('body').on('click','#submit',function(){
function apply(){
var company = $('#company').val();
var formData = new FormData(document.querySelector("#form"));
var address = $('#address').val();
var phone = $('#phone').val();
var cz = $('#cz').val();
var email = $('#email').val();
var name = $('#name').val();
var cate = $('#cate').val();
var prospectus = $('#prospectus').val();
$.ajax({
$.ajax({
type: 'post',
type: 'post',
dataType: 'text',
// dataType: 'text',
// dataType: 'json',
// dataType: 'json',
url: 'https://suzhou.njrenzhou.cn/api.php/apply/apply',
url: 'https://suzhou.njrenzhou.cn/api.php/apply/apply',
data: {
data: formData,
'company': company,
processData: false, // 不处理数据
'address': address,
contentType: false, // 不设置内容类型
'phone': phone,
// beforeSend:function(){
'cz': cz,
// if (!company) {
'email': email,
// alert('融资公司不能为空');
'name': name,
// return false;
'cate': cate,
// }
'prospectus': prospectus
// else if (address == '') {
},
// alert('地址不能为空');
beforeSend:function(){
// return false;
if (!company) {
// }
alert('融资公司不能为空');
// else if (phone == '') {
return false;
// alert('手机号码不能为空');
}
// return false;
else if (address == '') {
// }
alert('地址不能为空');
// else if(!phone.match(/^1(3|4|5|8)\d{1}[-]?\d{4}[-]?\d{4}$/)){
return false;
// alert('手机号码格式错误');
}
// return false;
else if (phone == '') {
// }
alert('手机号码不能为空');
// else if (cz == '') {
return false;
// alert('传真不能为空');
}
// return false;
else if(!phone.match(/^1(3|4|5|8)\d{1}[-]?\d{4}[-]?\d{4}$/)){
// }
alert('手机号码格式错误');
// else if (email == '') {
return false;
// alert('邮箱不能为空');
}
// return false;
else if (cz == '') {
// }
alert('传真不能为空');
// else if (name == '') {
return false;
// alert('姓名不能为空');
}
// return false;
else if (email == '') {
// }
alert('邮箱不能为空');
// else if (cate == '') {
return false;
// alert('行业分类不能为空');
}
// return false;
else if (name == '') {
// }
alert('姓名不能为空');
// else if (prospectus == '') {
return false;
// alert('商业计划书不能为空');
}
// return false;
else if (cate == '') {
// }
alert('行业分类不能为空');
// else return true;
return false;
// },
}
success:function(res){
else if (prospectus == '') {
console.log(res);
alert('商业计划书不能为空');
if (res.code == 200) {
return false;
}
else return true;
},
success:function(data){
console.log(data);
if (data.msg = 'success') {
alert('提交成功');
alert('提交成功');
window.location.reload();
window.location.reload();
}else{
}else{
alert('提交失败' );
alert(res.msg);
}
}
},
},
error:function(){
error:function(){
alert('error');
alert('error');
}
}
})
})
})
}
< / SCRIPT >
< / SCRIPT >