Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically populating fields

Status
Not open for further replies.

langloic

IS-IT--Management
Feb 26, 2005
7
US
Hi,

I am creating a form using HTML and JSP.

I connect to my DB and perform a SQL stmt that retreives , emp_name and emp_id.
I then propulate a DDL with emp_name from my resulset above.

What I need is that when a value from the DDL changes, I call a new SQL statement , select t.task1 from emp e,task t where t.emp2task=e.emp_id
and e.emp_id=??? ==> id mapping the name selecte in the ddl,
and I need to display task1 in a text box situated just below the DDL.

I 've tried the onChange() and javascript but all i can do is an alert of the emp_name, not even the emp_id and I also don't know from javascript how to format and pass variable back to JSP ?

can anyone help me there?

Thanks.
 
Humm,

I didn't fully understand the question:

If you populate the DDL with a DB query, that's processed at server side. Javascript works at client side.

Once the JSP generates the html output, it won't get actualized until the next trip to the server (submit)

Cheers,

Dian
 
Hi Dian ,

What I wanted is in a way to force the submit from within the onChange() method.

I'll try with a submit and multiple frames.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top