/    Sign up×
Community /Pin to ProfileBookmark

Name selection like vb

I want to give selection of name like vb ….
i.e. :
if user wants to select supreme
… from …
anil, piyush, samir, sunil, supreme, suresh, vipul …
… initially list should display …
all names
… if user entes ‘s’ (for supreme) …
… list should display … samir to suresh
… if user enters ‘su’ (for supreme) …
… list should display … sunil to suresh
… if user enters ‘sup’ (for supreme) …
… list should display … supreme
… i have solution like ….
[url]http://javascript.internet.com/forms/list-chooser.html[/url]
… but it does not allow downarrow key feature … means if user goes to ‘su’ and press down arrow … user must be able to go to supreme (instead of typing ‘sup’)

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@baconbuttyNov 26.2004 — Have a look at this:-

[URL]http://www.webreference.com/programming/javascript/gr/column5/index.html[/URL]
Copy linkTweet thisAlerts:
@Warren86Nov 26.2004 — <HTML>

<HEAD>

<Script Language=JavaScript>

var allOptions = "Aaron, Daniel |Allen, Mike |Allgood, James |Alexander, Allison |Babich, Timothy |Bailey, Mary |Baker, George |Cahoon, Ron |Cannon, Edith |Connner, Anthony"
allOptions = allOptions.split("|");
var smartOptions = new Array();
var matchStr = "";
var n = 0;

function insertOptions(){

Form1.isList.length = 1;
for (each in smartOptions)
{
isData = new Option(smartOptions[each],smartOptions[each]);
Form1.isList.add(isData,Form1.isList.options.length);
}
}

function buildOptions(){

smartOptions.length = 0;
endClip = matchStr.length;
for (each in allOptions){if (matchStr == allOptions[each].slice(0,endClip).toLowerCase())
{smartOptions[n++] = allOptions[each]}}
n = 0;
insertOptions();
}

function buildMatch(){

tmpStr = Form1.isText.value;
matchStr = tmpStr.toLowerCase();
if (tmpStr.length != 0){buildOptions()}
if (tmpStr.length == 0){initList()}
}

function getChoice(isChoice){

alert(isChoice);
}

function initList(){

Form1.isList.length = 1;
for (each in allOptions)
{
isData = new Option(allOptions[each],allOptions[each]);
Form1.isList.add(isData,Form1.isList.options.length);
}
Form1.isText.focus();
}


</Script>

</HEAD>

<br>

<center>

<Form name='Form1'>

<Table cellspacing=0 cellpadding=2 style='border:solid black 1px;font-family:Arial;font-weight:bold;font-size:12pt;width:200px;height:110px;background-color:lightyellow'>

<THead>

<TR><TH colspan=4 bgcolor=lightblue>Name List</TH></TR>

</THead>

<TR>

<TD align='right' style='font-size:11pt'>Trim At:</TD>

<TD><input type='text' name='isText' size='15' onKeyup="buildMatch()"></TD>

</TR>

<TR>

<TD align='center' colspan='2'>

<Select name='isList' onchange="getChoice(this.value)" style='width:151px'>

<option selected value='null'>Make a Selection</option>

</Select>

</TD>

</TR>

</Table>

<Script> initList() </Script>

</Form>

</center>

</BODY>

</HTML>
Copy linkTweet thisAlerts:
@vipuldshah77omauthorNov 26.2004 — The solution given by ... works ok, but only thing is ... if user presses 'A' and then if he wants to press down arrow key and select from list, it does not work. ('A' minimise the results starting from 'A' , and then if user wants to select allen, it is not possible to press down arrow key and then select)
Copy linkTweet thisAlerts:
@Warren86Nov 26.2004 — You are mistaken.

The code does not work as you assert. If the user inputs the letter A (upper or lower case) into the "Trim At" box, ALL of the names beginning with A are displayed in the select list.


Therefore, contrary to what you have alleged, Allen, IS LISTED, if the user subsequently presses the down button.


But, no matter. I have nothing further to offer, and am unsubscribing from this thread.
×

Success!

Help @vipuldshah77om spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...