我想我們可以做的是,當他們只使用最低價格(Price From)進行搜索並單擊搜索時,它會顯示消息,請填寫最高預算。這裏是網站http://www.phpropertydeals.com,然後點擊搜索分鐘。和最大值,我可以做什麼時,我加價格(價格),然後(價格)將提示必填字段。但如果沒有輸入,在這部分將繼續搜索。如何提示用戶輸入最低和最高價格的驗證?
<div class="mini-field">
<input input name="pricefrom" class="txt-field-input-mini formattingNumber" placeholder="Price from" style="width:159px;">
<input input name="priceto" class="txt-field-input-mini formattingNumber" placeholder="Price to" title="Please input maximum price budget" style="width:159px;">
</div>
<script type="text/javascript">
$(document).ready(function() {
var pricefrom = $('input[name="pricefrom"]');
$(pricefrom).on('click', function() {
if($('input[name="priceto"]').val().length < 1) {
alert("You must insert Maximum price!");
}
});
});
</script>
是的,這是正確的,但是當用戶添加價格從它應該有一個自動請在價格中說明「請輸入最高價格預算」 – DMoz 2014-12-08 07:00:27
當我從價格中添加價格時,它將向用戶要求他/她添加最高價格。 – DMoz 2014-12-08 07:01:46