Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.
<p id="searchresults">
<span class="category">foo</span>
<a href="sdksks.php">
<img src="search_images/pic.jpg" alt="" />
<span class="searchheading">dldldl</span>
</p>
<?php
$(function() {
$('#abbrev').val("");
$("#state").autocomplete({
source: "states.php",
minLength: 2,
select: function(event, ui) {
$('#state_id').val(ui.item.id);
$('#abbrev').val(ui.item.abbrev);
}
});
$("#state_abbrev").autocomplete({
source: "states_abbrev.php",
minLength: 2
});
});
?>
when I type in more then 2 characters in the "State (abbreviaton in separate field): " text box (id=state), the text box extends downwards by as much as the number of rows it is getting from the status.php page
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
In states.php, replace :
$row_array['name'] = $row['name'];
by :
$row_array['value'] = $row['name'];
and in the javascript, replace :
$('#state_id').val(ui.item
by :
$('#state_id').val(ui.item