Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

In Key Events shall we call "action" attribute

Thread view: 
Neelu - 17 Jan 2006 08:37 GMT
In my form i have one textbox whenever i will give data( nearly 2 to 3
characters), the key press event should go and call to some jsp for
fetching data from database depend upon the data given.  I got this by
using submit button. I need this one using key event. Is it possible?
Venky - 17 Jan 2006 09:07 GMT
I guess you can do it..

Code would look something like this

textbox.addKeyListener(
     new KeyListener() {
           int i=0;
           void keyPressed(KeyEvent e) {}
           void keyReleased(KeyEvent e) {}
           void keyTyped(KeyEvent e) {
                     i++;
                     if(i>2) //if number of characters entered is > 2
                     {
                             //  Do some action
                     }
           }
   }
);
Neelu - 20 Jan 2006 10:35 GMT
Its really nice...but som syntax error is coming in java script....can
u clarify it
Dag Sunde - 20 Jan 2006 11:33 GMT
> Its really nice...but som syntax error is coming in java script....can
> u clarify it

Your problem is that you asked what probably is a JavaScript question
in a Java newsgroup.

You got a Java code response, but used it as JavaScript Code...
Two different languages with some syntactic similarities...

Try "comp.lang.javascript".

Signature

Dag.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.