How to dynamically create textbox for a WEBpage

A

Asad

I am working on part of a web application, where if a user clicks a
button, I am supposed to give him an additional textbox. If he clicks
it again, another ... so on and so forth.

I am just trying to think up of possible ways of doing this. In JSP
maybe i can invoke a bean function that helps me do that ... hmmm ...

Does Java provide built in functionality for generating dynamic text
boxes on a webpage?

How else can I do it? Ideas??

Thanks.

asad
 
C

Christophe Vanfleteren

Asad said:
I am working on part of a web application, where if a user clicks a
button, I am supposed to give him an additional textbox. If he clicks
it again, another ... so on and so forth.

I am just trying to think up of possible ways of doing this. In JSP
maybe i can invoke a bean function that helps me do that ... hmmm ...

Does Java provide built in functionality for generating dynamic text
boxes on a webpage?

How else can I do it? Ideas??

No you can't with Java, since you'll need to generate those extra boxes on
the client. Your JSP runs on the server and generates HTML that it sends to
the client.

To manipulate the HTML on the client, and to add extra textboxes, you'll
need javascript.
 
P

Peter Kirk

Christophe Vanfleteren said:
Asad wrote:
No you can't with Java, since you'll need to generate those extra boxes on
the client. Your JSP runs on the server and generates HTML that it sends to
the client.

To manipulate the HTML on the client, and to add extra textboxes, you'll
need javascript.

That, or you could have a button which sends a request to your jsp/servlet
which then generates html with the desired number of textareas... No idea if
that is a "good" solution.

How does it work with .NET? I've only briefly seen some webapp stuff written
in C#, where there were "button events" etc ("code behind" I think it was
called). Are there round-trip requests to the server for user interactions?
 
L

Liz

Peter Kirk said:
That, or you could have a button which sends a request to your jsp/servlet
which then generates html with the desired number of textareas... No idea if
that is a "good" solution.

how about this, it works in an application?

listDialog = new JDialog(parent, title);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,277
Latest member
VytoKetoReview

Latest Threads

Top