I have a form in jsp consisting of emp no and emp name. Now what i want is when i enter emp no than emp name of that employee should automatically be displayed fetching from database. Please help
Hi, if you want see name of a employee dynamically then u shud dispaly employee numbers in dropdown list b'coz for toching database some event shud happen. regards Ajith
Show a text field for emp id & disabled list box for emp name initially. Once the user tabs out of the text field or hits the enter key, handle the event and submit the page. The submission of the form, should make the necessary DB hit to get the appropriate (or related set ) of emp names. If there is too much data, I don't see the list box as an option.. hope this helps..
hai, for this i think u can do like this. u call a function on onblur event of a textbox and there u submit the form. something similar to <input name=text onblur="call();"> in the call function u can submit the form. hope this helps jyothsna
I am not able to do it since in the function i need to get connected to database to get the emp name.Than how to connect from jsp to javascript fnction and than connect to database in javascript? so pls give soln in jsp..?
u can do like this. create a function which u want to call on onblur event like this <script language="javascript"> function call() { --- ----- } </script> here u write the necessary code. or u can submit the form and do the things related to the database and then come back to the jsp page and display the results. still have problems,ask me jyothsna
This is quite raw, you can do in more cleaner way. Now in the html you can do something like this...
hth MB ps. do chk out for the proper javascript statment to submit the form & to diable a form element, am not quite sure abt them. [ November 11, 2003: Message edited by: Malhar Barai ]
This is what i really want... There r many fields in the form ...the first 2 are emp no and emp name...in jsp page!! Now when the user enters the no in the first field...the emp name of that particular employee should be displayed fetching from the database.
Without deviation from the norm, progress is not possible - Zappa. Tiny ad:
New web page for Paul's Rocket Mass Heaters movies