Page 1 of 1

[SOLVED] textbox onkeypress to change the select box value

Posted: Wed Mar 30, 2005 9:31 pm
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>

Posted: Wed Mar 30, 2005 9:34 pm
by John Cartwright
Moved to client side.

Posted: Wed Mar 30, 2005 9:52 pm
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.

Posted: Wed Mar 30, 2005 9:56 pm
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

Posted: Thu Mar 31, 2005 5:13 am
by valen53
i settle the problem.
Please refer this URL
http://www.codingforums.com/showthread. ... id=153089
thanks to all