由于自动完成,我试图将搜索文本框的值带到下一页。但它只接受在搜索框中输入的值。
我正在使用的代码是:
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="" />
对此的任何建议将不胜感激