我的表格是用贾瓦特文链接提交的,但我也试图证实从正义获得认可。 如果通过该链接提交,验证工作就没有工作,但如果我改变与提交纽州的联系,则会这样做。 我做了什么错误?
我的形式:
<form id="findmatch" method="post" action="search">
<div>
<label class="formlabel">Match Type
<input type="text" name="matchtype" id="matchtype" class="forminput" />
</label>
<label class="formlabel">Location (postcode)
<input type="text" name="location" id="location" class="forminput" />
</label>
<label class="formlabel">Radius (miles)
<input type="text" name="Radius" id="Radius" class="forminput" />
</label>
<label class="formlabel">Keywords
<input type="text" onblur="javascript:usePointFromPostcode(document.getElementById( location ).value, showCompleteLatLng)" onchange="javascript:usePointFromPostcode(document.getElementById( location ).value, showCompleteLatLng)" name="keywords" id="keywords" class="forminput" />
</label>
<input id="lat" class="hidden" name="lat" type="text" value="" />
<input id="lon" class="hidden" name="lon" type="text" value="" />
<a href="javascript:document.getElementById( findmatch ).submit();" onmouseover="javascript:usePointFromPostcode(document.getElementById( location ).value, showCompleteLatLng)" class="submit">Search</a>
</div>
</form>
我的笑话
<script type="text/javascript">
$(document).ready(function () {
$("#findmatch").validate({
rules: {
location: "required",
Radius: {
required: true,
digits: true
},
keywords: "required"
},
messages: {
location: "Please enter your postcode",
Radius: {
required: "Please enter a radius",
digits: "Please only enter numbers"
},
keywords: "Please enter the keywords you wish to search for"
}
});
});
</script>