autocomplete/ form
autocomplete/ form
hi dear i have a problem in autocomplete form
i have
this is my html
<div id="searchform">
<form name="searchpage" id="searchpage" method="GET" action="<?php echo views_helper ::draw_form_action('search');?>">
<table width="93%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="grey_strip" colspan="2" align="center" valign="middle"><span class="body_bold">Search Users</span></td>
</tr>
<tr>
<td class="item_head" align="right" style="padding-right:15px;" width="23%" height="30">Name :</td>
<td width="75%" class="light_grey_bg"><span style="padding:2px;">
<input type="text" name="name" id="name" value="<?= $this->user->name?>" class="border3" maxlength="255" /></span></td>
</tr>
<tr>
<td class="item_head" align="right" style="padding-right:15px;">Email :</td>
<td class="light_grey_bg"><span style="padding:2px;">
<input type="text" name="email" id="email" tooltipText="Type in page url" value="<?= $this->user->email?>" class="border3" maxlength="255" /><br><p class="notification">ex@example.com</p></br></span></td>
</tr>
<tr>
<td class="item_head" align="right" style="padding-right:15px;">Status :</td>
<td height="30" class="light_grey_bg"><span style="padding:2px;">
<select name="status" id="status" class="border3">
<option value="Active" <? if($this->user->status == 'Active') { echo "selected";}?>>Active</option>
<option value="Inactive" <? if($this->user->status == 'Inactive') { echo "selected";}?>>Inactive</option>
</select></span>
</td>
</tr>
<tr>
<td class="grey_strip" colspan="2" align="center">
<input type="submit" id="search" onclick="lookupAjax();" name="search" value="search" />
</td>
</tr>
</table>
</form>
</div>
this is my javascript
function findValue(li) {
if( li == null ) return alert("No match!");
// if coming from an AJAX call, let's use the nameid as the value
if( !!li.extra ) var sValue = li.extra[0];
// otherwise, let's just display the value in the text box
else var sValue = li.selectValue;
alert("The value you selected was: " + sValue);
}
function selectItem(li) {
findValue(li);
}
function formatItem(row) {
return row[0] + " (id: " + row[1] + ")";
}
function lookupAjax(){
var oSuggest = $("#name")[0].autocompleter;
oSuggest.findValue();
return false;
}
function lookupLocal(){
var oSuggest = $("#namelocal")[0].autocompleter;
oSuggest.findValue();
return false;
}
$("#name").autocomplete(
"?admin/user/autocomplete",
{
delay:10,
minChars:2,
matchSubset:1,
matchContains:1,
cacheLength:10,
onItemSelect:selectItem,
onFindValue:findValue,
formatItem:formatItem,
autoFill:true
}
);
});
and i am attached all the file jquery and css but i have not respone in name text.
------------------------------
MANISH PAL
kadmine
http://www.kadmine.com