这是我的客户网站http://mumbaiestatemarket.com/admin 用户名:admin 通过:管理员
我对日期,计算和自动电台名称感到惊讶
当自动电台名称进入文本框时,...计算和日期框不会出现......
这是我的代码:
<!-- Add remove and calculation code-->
<script>
$(document).ready(function() {
//alert('hi');
var max_fields = 50; //maximum input boxes allowed
var wrapper = $(".input_fields_wrap"); //Fields wrapper
var input = $(".input_field"); // input field
var train = $(".train_field"); // train input field
//var add_fields = $(".add_field"); //Add button ID
var x = 1; //initlal text box count
var t = 1; //initial train count
$(input).on("click",".add_field",function(e){ //on add input button click
e.preventDefault();
if(x < max_fields){ //max input box allowed
x++; //text box increment
$(input).append('<tr><td height="40" width="300" align="center"><input style="border-radius:7px;" size="30" type="text" name="mytext[]"/></td><td align="center"><input style="border-radius:7px;" size="5" type="text" name="myage[]"/></td><td align="center"><select style="width:100px;height:22px;border-radius:7px;" name="mysex[]"><option>select</option><option>male</option><option>female</option></select></td><td ><input style="border-radius:7px;visibility: hidden;" size="30" type="text"/></td><td><input style="border-radius:7px;visibility: hidden;" size="30" type="text"/></td><td align="center"><a href="#" class="add_field" style="color:green;text-decoration:none;font-size:20px;">Add</a></td><td align="center"><a href="#" class="remove_field" style="color:red;text-decoration:none;font-size:20px;">Remove</a></td></tr>'); //add input box
}
});
$(input).on("click",".remove_field", function(e){ //user click on remove text
e.preventDefault(); $(this).parent().parent().remove(); x--;
});
$(train).on("click",".add_train",function(e){ //on add input button click
e.preventDefault();
if(t < max_fields){ //max input box allowed
t++; //text box increment
$(train).append('<tr><td height="40" align="center"><input style="border-radius:7px;width:300px;" type="text" name="mytrain[]"/></td><td align="center"><input style="border-radius:7px;width:300px;" type="text" name="trainname[]"/></td><td align="center"><a href="#" class="add_train" style="color:green;text-decoration:none;font-size:20px;">Add</a></td><td align="center"><a href="#" class="remove_train" style="color:red;text-decoration:none;font-size:20px;">Remove</a></td></tr>'); //add input box
}
});
$(train).on("click",".remove_train", function(e){ //user click on remove text
e.preventDefault(); $(this).parent().parent().remove(); t--;
});
$('#ppc').on('change',(function(e) {
e.preventDefault();
var formData = new FormData(document.getElementById('travelform'));
$.ajax({
type:'POST',
url: 'ajax.php',
data:formData,
cache:false,
contentType: false,
processData: false,
success:function(data){
$("#tc").val(data);
console.log("success");
console.log(data);
},
error: function(data){
console.log("error");
console.log(data);
}
});
}));
$('#ap').on('change',(function(e) {
e.preventDefault();
var formData = new FormData(document.getElementById('travelform'));
$.ajax({
type:'POST',
url: 'ajax1.php',
data:formData,
cache:false,
contentType: false,
processData: false,
success:function(data){
//alert(data);
$("#pp").val(data);
console.log("success");
console.log(data);
},
error: function(data){
console.log("error");
console.log(data);
}
});
$.ajax({
type:'POST',
url: 'ajaxstatus.php',
data:formData,
cache:false,
contentType: false,
processData: false,
success:function(data){
//alert(data);
$("#st").val(data);
console.log("success");
console.log(data);
},
error: function(data){
console.log("error");
console.log(data);
}
});
}));
});
</script>
<!--Date Code-->
<link rel="stylesheet" href="css/jquery-ui-1.10.4.custom.css" />
<!-- Load jQuery JS -->
<script src="js/jquery-1.10.2.js"></script>
<script src="js/jquery-ui-1.10.4.custom.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#cal").datepicker({dateFormat:"dd/mm/yy"});
});
</script>
<!--Station code-->
<link rel="stylesheet" type="text/css" href="css/jquery.autocomplete.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.autocomplete.js"></script>
<script>
$(document).ready(function(){
$("#tag").autocomplete("autocomplete.php", {
selectFirst: true
});
$("#tag1").autocomplete("autocomplete.php", {
selectFirst: true
});
});
</script>
&#13;
注意:当我删除Station代码然后Datebox和计算人均工作正常。