-2
我試圖驗證這種形式:jQuery Mobile的驗證不工作,即不顯示驗證信息
<form id="manage-form" data-ajax="false">
<label for="business_Name" >Business Name:</label>
<input type="text" class="required" name="business_Name" id="business_Name" data-mini="true"/>
<input id="submission" type="submit" value="insert"/>
</form>
與此javascript:
var amandeepdb;
$(document).ready(function(){
amandeepdb = openDatabase('AAFeedbackdb','1.0','AAFeedbackdb','2*1024*1024');
createTable();
insertAAType();
$("#submission").on("click", function (evt){
handleAddForm();
return false;
});
});
function handleAddForm(){
$('#manage-form').validate({
rules: {
business_Name: {
required: true,
rangelength:[2,30]
}
},
messages: {
business_Name: {
required: "required",
rangelength : "between 2 to 30"
}
}
});
}
它沒有驗證,當我點擊插入按鈕即不顯示消息。 頁面只刷新並且不顯示消息。