1
我試圖採取將自動填充的結果作爲搜索文本框的值到下一頁。但它只會將輸入的值輸入到搜索框中。表單未提交自動填充值到下一頁
,我使用的代碼是:
function fill(thisValue) {
var abc = $('#search').val(thisValue);
alert(abc);
$('#rad').show();
setTimeout("$('#suggestions').hide();", 200);
document.getElementById("Form1").submit();
}
HTML:
<form action="<?php echo $mainUrl?>/search" method="post" name="Form1" id="Form1" onsubmit="if((document.getElementById('search').value === '') || (document.getElementById('search').value === 'Search billions of items at the single Platform')){ document.getElementById('search').focus(); return false;};">
<input type="text" name="search" placeholder="Search billions of items at the single Platform" id="search" onkeyup="lookup(this.value);" onblur="fill();" autocomplete='off' value="" />
<input type="submit" name="submit_btn" value="search" class="button" id="button" />
<div class="suggestionsBox" id="suggestions" style="display: none;">
<img src="<?php echo $mainUrl?>/resources/autocomplete/autoComplete/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
<div class="suggestionList" id="autoSuggestionsList">
and html
<input type="text" name="search" placeholder="Search billions of items at the single Platform" id="search" onkeyup="lookup(this.value);" onblur="fill();" autocomplete='off' value="" />
對此有何建議將高度讚賞
你可以添加html和輸入的css你正在改變的值 – Pete 2013-02-22 15:01:15
請找到css和html。您也可以通過在搜索框中輸入來查看http://www.dailybargains.com。 – 2013-02-22 15:22:57
對不起,不需要表單 - 只是輸入和應用於輸入的樣式,但如果你看着你輸入的'blur',你可以看到你正在調用'fill()'並且什麼都沒有傳入你將'#search'的值設置爲你的函數中的任何東西 – Pete 2013-02-22 15:26:59