0

Create unlimited dynamic textbox and insert that value which is fill by user in database.how to do it in JSP, Servlet and Hibernate , MySQL
explanation:suppose i fill my name "David" in 1 textbox now i clik add more generate 1 text box fill in this "Chris" if wanna more addthn click more fill it and finnaly he wants submit thn insert all value of these dynamic textbox in database.
pls send solution how to do it

2
Contributors
1
Reply
4
Views
8 Years
Discussion Span
Last Post by __avd
0

Welcome funwithme.

Please read How to post?.

You may use request.getParameterValues() method.

<%@ page language="java" %>

<%
    String []ar=request.getParameterValues("name");

    String cmd=request.getParameter("cmd");
    if(cmd==null) cmd=""; 
   if(cmd.equals("Submit")){
    for(int i=0;i<ar.length;i++) {
          out.println(ar[i]);
    } 
   }
%>

<form method="post" action="page3.jsp">

<br/><input type="text" name="name"/>
<br/><input type="text" name="name"/>
<br/><input type="text" name="name"/>
<br/><input type="text" name="name"/>
<br/><input type="text" name="name"/>
<br/> <input type="submit" value="Submit" name="cmd"/>
</form>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.