These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

dynamically populate textbox with database values when value is select

naina639
Registered: Mar 25 2008
Posts: 2

hi can u pls solve my problem

i want to populate a combobox from mysql db and i want that suppose i select an option the related data of other columns of the same table should be displayed in text box.i am using jsp and mysql.

%String CategoryCombo = null;
%>
<%while(rs.next())
{
CategoryCombo = rs.getString("emp_name");%>
<%<%out.println(CategoryCombo)%>

%>
<%}%>

<%String viewText=null;%>
<% rs1=stmt.executeQuery("select * from emp where emp_name='"+CategoryCombo+"');%>
<%while(rs1.next())
{
viewText=rs1.getString("emp_job");%>
Emp jod id="empdes" readonly=true>
<%}%>

when i write this code the combo box is populated but i get problem in the where conditon and also i do not get data in the text box.please provide me with a solution.

My Product Information:
Acrobat Standard 8.1.2, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You can do this. Assuming that your DB is remote, you'll need use the "submitForm()" function in Acrobat JavaScript to prompt the JSP script on the server to return the list data in FDF. If things are setup correctly, Acrobat will use the FDF to populate the combobox list.

You'll need to read about form submission in Acrobat/PDF and FDF. You'll find info about FDF in the PDF Specification, which you can download from here:

http://www.adobe.com/devnet/acrobat/

Before you try this out from your server script you'll to try it out by importing the FDF from a local folder, so you know the FDF format is correct.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script