[SOLVED] textbox onkeypress to change the select box value

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
valen53
Forum Contributor
Posts: 137
Joined: Tue Aug 27, 2002 9:29 am

[SOLVED] textbox onkeypress to change the select box value

Post by valen53 »

HI ALL,
I want do a search function something like i keyin in textbox then the selectbox will auto change the value without refresh the page depend on what i keyin in textbox.

Anybody done it before ?
Any website can refer ?

Code: Select all

<input type=&quote;text&quote; name=&quote;textfield&quote; onKeyPress=&quote;ChangeSelect()&quote;>
   <select name=&quote;select&quote;>
      <option>TESTING</option>
    </select>
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Moved to client side.
valen53
Forum Contributor
Posts: 137
Joined: Tue Aug 27, 2002 9:29 am

Post by valen53 »

sorry for make confuse.

Actually it was using PHP + java script for coding, b'cos after onkeypress, it will go to Database to select the record and return the record to select box.

That why i put it in PHP forum.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

most dropdowns already possess some key handling, typically they will jump to the first letter you press already. Down and up also typically change the selected item down and up from the current selection.

Unless you're talking about something like Google Suggest: http://www.google.com/webhp?complete=1&hl=en
valen53
Forum Contributor
Posts: 137
Joined: Tue Aug 27, 2002 9:29 am

Post by valen53 »

i settle the problem.
Please refer this URL
http://www.codingforums.com/showthread. ... id=153089
thanks to all
Post Reply