Results 1 to 2 of 2
  1. #1
    meghana is offline Member
    Join Date
    Mar 2010
    Rep Power

    Default dynamically query handling


    we are developing page that contain checkbox and textbox which are dynamically generated.when we click on check box textbox will be enable.we enter value in we want to insert that values in database on click event of button. rest of values should not enter in database, but we are not manupulate dynamic button and check box.

    Source Code:

    <%@page session="false" %>
    <%@page import="java.util.*"%>
    <%@page import="java.sql.*"%>

    <head> </head>
    Statement st=null;
    Connection con=null;
    ResultSet rs=null;

    con=DriverManager.getConnection("Jdbc:Odbc:unisoft ");
    st = con.createStatement();
    rs = st.executeQuery("SELECT * from course");
    <form name="form" method="post" action="">
    <table border="1" align="center" width=650 height=0 cellpadding=8>
    <td colspan=3> <font size=4> Fees Structure <hr> </font> </td>
    <td width=92> Course Name </td>
    <td width="7"> : </td>
    <td width="200"> <select name="course">
    <option value="abc">ABC</option>
    <% while(
    <option value="<%= rs.getString(1)%>"> <%= rs.getString(2) %></option>
    <% } %>
    </select> </td>
    if(st!=null) st.close();
    //if(rs!=null) rs.close();
    if(con!=null) con.close();
    <table border="1" align="center" width=650 height=0 cellpadding=8>
    <td width=92> Course Name </td>
    <td width="7"> : </td>
    <td width="200"> <select name="course">
    <option value="Day"> Day </option>
    <td>&nbsp; </td>
    <tr align="center">
    <td> <input type="button" name="next" value="Next" style="width:100"> </td>
    <td> <input type="button" name="next" value="Reset" style="width:100"> </td>
    <td> <input type="button" name="next" value="Cancel" style="width:100"> </td>
    <td>&nbsp; </td>

    help us to solve that problem.



  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Rep Power


    maybe have some onclick javascript for the submit button find the selected checkbox, and then its associated text field, copy the value into a second html form, and post that form back. this way the form going to the server will just have the one field that you wish to save.

Similar Threads

  1. How to resize the component dynamically??
    By Y. Progammer in forum New To Java
    Replies: 14
    Last Post: 03-17-2010, 05:04 PM
  2. How to create widgets dynamically
    By sarbuland in forum Advanced Java
    Replies: 0
    Last Post: 02-06-2008, 08:08 PM
  3. Dynamically changing the display
    By abhiN in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 01-22-2008, 11:19 PM
  4. Overloading methods dynamically
    By Syed.muddasir in forum New To Java
    Replies: 6
    Last Post: 07-31-2007, 02:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts