I want to display the quantity of the selected item of a drop down list in a textbox. The data is stored in database.

I want to display the quantity of the selected item of a drop down list in a textbox. The data is stored in database.

The code for retrieving data from database into Drop Down List.

    <%
     DataSource data = new MysqlDataSource();
     Connection con =  data.getConnection("root","system");
     System.out.println("Connected to MySQL"); 
     PreparedStatement pre = con.prepareStatement("select * from library.booklist");
     ResultSet result = pre.executeQuery();

%> Book List : // my code for displaying quantity is below but its now working.I am new to jsp, so dont know how to populate the textbox//

  <%

 String value = request.getParameter("BookList");
 pre = con.prepareStatement("select Quantity from library.booklist where Book = ? ");  
 result = pre.executeQuery();
 %>
  <font color="black" size="5"><td> Quantity : </td>
<%

 while (result.next())
 {
int quantity = result.getInt("Quantity");
System.out.println("quantity dikha raha hai");
%>
<input name = "Quantity" type = "text" size = "25" readonly = "readonly" value = "<%=quantity%>"> <%=quantity%> </input>
 <%
 }
 %>
 </td>
 </tr>
View Answers









Related Tutorials/Questions & Answers:
I want to display the quantity of the selected item of a drop down list in a textbox. The data is stored in database.
I want to display the quantity of the selected item of a drop down list in a textbox. The data is stored in database.  The code for retrieving data from database into Drop Down List. <% DataSource data = new
how to make drop down list in JSF & fetch data Item from database
how to make drop down list in JSF & fetch data Item from database  how to make drop down list in JSF & fetch data Item from database
Advertisements
Display related data in other drop down list on selecting one data in one drop down list
Display related data in other drop down list on selecting one data in one drop down list  How to display related datas in dropdown list from database on selecting one data in previous dropdownlist in Java Server Page
view data from database using drop down list
view data from database using drop down list  hi i want to view the data from database by selecting a value in a drop down list. for an example drop down list have picture element.when click it select pictures from the database
The code for retrieving data from database into Drop Down List.
The code for retrieving data from database into Drop Down List.  <% DataSource data = new MysqlDataSource(); Connection con...; Book List : - select - <% while
How to send the data selected from drop down menu from html page to sql 2005 database.
How to send the data selected from drop down menu from html page to sql 2005 database.  Dear Sir, If I want to save the information provided... system ,how can I save these data in database and how to retrieve later .Thanks
display data from database in textbox when id entered in textbox
display data from database in textbox when id entered in textbox  i wanted to enter data in textbox .depending on entered data in textbox data from database should be displayed dynamically in textbox
retrive the data from access database to drop down list box in jsp
retrive the data from access database to drop down list box in jsp  hai, im new to jsp now im using the jsp along with access database.in table i load all the data's i need to retrive the data from database to dropdown list box
How to insert multiple drop down list data in single column in sql database using servlet
How to insert multiple drop down list data in single column in sql database using servlet  i want to insert date of birth of user by using separate drop down list box for year,month and day into dateofbirth column in sql server
Drop down list from database
Drop down list from database  Hi, Can I know how do we get the drop down list from database? Eg: select country--select state--select district--so..., we have created two database tables: CREATE TABLE `country
nested selected tag ihave display selected item
nested selected tag ihave display selected item   i have two combo..., ok it can be done by creating array my problem is when i display data like..." , but i want "INDIA", and i use if condition for each value and display by using
to update drop down list value when selected from website
to update drop down list value when selected from website  hi help me, i want to insert value into db when i select from a drop down list...;" <?php if($row_list['Age_Id']==$select){ echo "selected"; } ?>> <
to update drop down list value when selected from website
to update drop down list value when selected from website  hi help me, i want to insert value into db when i select from a drop down list...;" <?php if($row_list['Age_Id']==$select){ echo "selected"; } ?>> <
to update drop down list value when selected from website
to update drop down list value when selected from website  hi help me, i want to insert value into db when i select from a drop down list...;" <?php if($row_list['Age_Id']==$select){ echo "selected"; } ?>> <
store values of drop down list box in database
store values of drop down list box in database  how to store values of drop down list box in oracle database in jsp?I have information inserting form where i have date of birth as drop down list box
Drop down for search textbox like google search
Drop down for search textbox like google search  I want drop down like google search (ie, when we type one letter then the word start with that are displayed). when the drop down list appear, then we can select one of word as our
Ajax drop down and textbox
Ajax drop down and textbox  hie frnds I have a dropdown menu in the 3 options(1,2,3) are there if i choose 1 then I should get 1 text box if i select...;   THank u very much i have sucesfully executed it......   
data should not repeat in the drop down list when it is loading dynamically from database
data should not repeat in the drop down list when it is loading dynamically... im new to us it and i tried almost to display it right. Please could any one...); } %> the data tables used for this are dept: CREATE TABLE `dept
data should not repeat in the drop down list when it is loading dynamically from database
data should not repeat in the drop down list when it is loading dynamically... the data dynamically for database but my problem is in the list the same...); } %> Data base tables are dept CREATE TABLE `dept
data should not repeat in the drop down list when it is loading dynamically from database
data should not repeat in the drop down list when it is loading dynamically... the whole department field from the data base (i.e in the drop down list... be included in the drop down list. 1)selDept.jsp: <%@page import
dynamic drop down list
dynamic drop down list  I want to create 2 drop down list, where it takes value from database and the two list are dependent..means if I select a particular value from one the other list is developed accordingly..depending
how to retreive data dynamically from mysql to drop down list
how to retreive data dynamically from mysql to drop down list   sir... fron end using jsp , after storing the data successfully .i want to retrieve the data of a particular column in a table into drop down list dynamically
display table details when selecting table name in drop down liat
display table details when selecting table name in drop down liat  Hello, Am having problem in my project... i want to retrive the data from mysql database to the dropdownlist in jsp. Example: 1st i want to display the list
How to obtain the selected data item from a list box when listbox contains objects wrapped under Arraylist?
want to copy the selected item(one at a time) from the list box to the text box. I...How to obtain the selected data item from a list box when listbox contains objects wrapped under Arraylist?  I have a jsp page containing a list box
Dependent drop down list
dependent drop down list is used my code is successful but when i select class from first drop down list all the data get lossed means the value entered in fields before drop down list get blank.what can i do for this? This is the code
validation for drop down list
validation for drop down list  Hi all I have a form, it contain 12 drop down list. Each drop down has 1 to 5 values,i need to validate this form. the following condition should be true. 1.you can choose only 3 times 5 value. 2
drop down list in Struts
drop down list in Struts  How to create a drop down list in Struts
using ajax i want to insert data into oracle database
using ajax i want to insert data into oracle database  i would like to insert/update/select/delete from jsp to oracle database using ajax? please send a code for this iam using oracl database thank you
Retriving data stored in database
Retriving data stored in database  Hi, How to retrive data from my sql database using Hibernate,Spring and tapestry please give me an example.I am new to this Hibernate and Spring
insert data using drop down box in java into database postgresql
data into database using an drop down box .....as i m using eclipse as jdbc and postgresql as data base syntax which i m using is like:- java class...insert data using drop down box in java into database postgresql  can
insert data using drop down box in java into database postgresql
data into database using an drop down box .....as i m using eclipse as jdbc and postgresql as data base syntax which i m using is like:- java class...insert data using drop down box in java into database postgresql  can
insert data using drop down box in java into database postgresql
data into database using an drop down box .....as i m using eclipse as jdbc and postgresql as data base syntax which i m using is like:- java class...insert data using drop down box in java into database postgresql  can
insert data using drop down box in java into database postgresql
data into database using an drop down box .....as i m using eclipse as jdbc and postgresql as data base syntax which i m using is like:- java class...insert data using drop down box in java into database postgresql  can
Get values in drop down list
Get values in drop down list  Pls provide me jsp code to get values in drop down list from another table's field. my project has customer registration and company registration pages..... when i insert data in company
how to insert the selected item of combobox in mysql - XML
database.but after storing it has to display the alert box .like data has stored successfully.alert box have to display only if data was stored in database otherwise...how to insert the selected item of combobox in mysql  hi, i
Dependant & dynamic drop down list
Dependant & dynamic drop down list  I don't know this should be in this or AJAX forum. I have one dynamic drop down list from data base (working... on the values selected by user in first drop down list. How to achieve this ?   
how to store multiple values from drop down in database where i am using java struts 1.3
how to store multiple values from drop down in database where i am using java struts 1.3  hii, i am coding a form where i need a keyskills attribute where i have to select multiple keyskills. but it is taking only one valuee.. i
how to display textbox value based on selected option value?
how to display textbox value based on selected option value?  Hi,I have some problem. I use jsp and ajax. first select: 1 second select:2 based on first value I finished above code. ID: xx Name:xx xx is baesd on second
Dynamically display values in dropdown box and then show the selected values as selected by the user which is already stored in the DB
trying to display multiple selection selected from the list of all the values in the list box. Somehow I can just show only one as selected but not multiple records...Dynamically display values in dropdown box and then show the selected values
Dynamically display values in dropdown box and then show the selected values as selected by the user which is already stored in the DB
Dynamically display values in dropdown box and then show the selected values as selected by the user which is already stored in the DB  The below.... so if I have 5 values in the dropdown this selected one is added as 6th values
i want display integer number in a string of statement
i want display integer number in a string of statement  i want display integer number in a string of statement
pbml in inserting selected item from combobox into mysql - XML
after storing it has to display the alert box .like data has stored successfully.alert box have to display only if data was stored in database otherwise it has...pbml in inserting selected item from combobox into mysql  hi, i have
how to import values from database to the drop down box
employee page i kept a drop down box for employee Ids i want all employee IDs will display in the drop down box please help me with the code...how to import values from database to the drop down box   hi iam
Getting Textbox data from database
Getting Textbox data from database  When i m trying to get data in textbox as readonly from database i m getting following error.and my code is shown... data from database and display it on the textboxes. <%@page language="java
How to store JComboBox selected Item into Ms Access Database - Java Beginners
How to store JComboBox selected Item into Ms Access Database  How to store JComboBox selected Item into Ms Access Database.  Hi Friend...(); int i=stmt.executeUpdate("insert into Student(Course) values('"+st
Getting Textbox data from database
Getting Textbox data from database  When i m trying to get data in textbox as readonly from database i m getting following error.and my code is shown...;Here is a jsp code that retrieves data from database and display
want to insert values in drop down menu in struts1.3
want to insert values in drop down menu in struts1.3  I am using DynaValidatorForm.please help me with inserting values in color drop down menu. I have tried belowwith arraylist but was not able to find solution. add.jspx
Hi, I'm new to JSP I want to create 3 dropdown list each depend on the other and get the options from the database using JSP
Hi, I'm new to JSP I want to create 3 dropdown list each depend on the other and get the options from the database using JSP  as i said i want to create 3 drop dropdown list each depend on the other and get the options from
i want to learn data science
i want to learn data science  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: i want... can learn the topic "i want to learn data science". Also tell me
How to save JCombobox Selected Item in to Access Database - Java Beginners
How to save JCombobox Selected Item in to Access Database  How to save JCombobox Selected Item in to Access Database  Hi Friend, Try... =DriverManager.getConnection("jdbc:odbc:access","",""); Statement stmt=con.createStatement(); int i

Ads