I have a jsp form with 3 buttons (New/View/Edit).

On clicking New..it should open another jsp form with some input field.
On clicking View..it should open the same jsp form with input field as readonly
on clicking edit..it should open the same jsp form with input field pre-populated..

can i do it with one jsp page..or should i need to create a separate form for each (New/View/Edit) action.

Please help ..

You create three inputs of type submit but with different values, then, in the jsp/servlet that is the target of the action field of the form, you simply look at the value of the submit parameter to decide what to display.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.