Forums Register Login

display data on same jsp page

+Pie Number of slices to send: Send



This is additem.jsp

Screenshot_1.png
This is my jsp page.
[Thumbnail for Screenshot_1.png]
Screenshot_2.png
If I click "add new item" button, then it goes another jsp page, i want this form in same jsp page,how it is passible?
[Thumbnail for Screenshot_2.png]
+Pie Number of slices to send: Send
@sarojni, Hello.

I notice that the script below has if-tests for the name of the launching button-click. You have one for "insert", which happens to be the value for two different submit buttons. One of those is the "add new item" button.



and this is from the JSP form:



Now, do you understand? Also, I do not know what you are going for here, but if I had been writing this, I would want the "Add new Item" button to land just where it is landing. Then, after completing the addition of the item, I might want it to land back on the display page.

Anyway, I hope this helps.
+Pie Number of slices to send: Send
I mean to say when I click "add new item" then then item form should be on "gold.jsp" means on same page mentioned in image...
Screenshot_3.png
this is gold.jsp
[Thumbnail for Screenshot_3.png]
+Pie Number of slices to send: Send
Ah. I've misunderstood. What you want is to combine the 2nd form with the first. That can be accomplished by just inserting the text of the 2nd form into the first. If you do that, your "Item Name" text input will always appear, whether you are trying to add anything or not.

You could also do that with JavaScript, where the new form grows into the screen in response to your button click, and can be deleted when you are done. Just look into JavaScript.

Sorry for the earlier confusion.
+Pie Number of slices to send: Send
I want 2nd form in first form, but I do not want , every time it appears, I want 2nd form only when when I click "add new item" button...
+Pie Number of slices to send: Send
You can't embed a form within a form. You can hide a set of forms element in the one form until you want them to appear with a button click.
+Pie Number of slices to send: Send
In that case, you can make a javascript function to add the form, whenever the button is clicked. Then when the form's own button is clicked, carry out the action, and use a javascript function to remove the form again. You would need to learn JavaScript to do that, however.
1
+Pie Number of slices to send: Send
 

L Foster wrote:In that case, you can make a javascript function to add the form, whenever the button is clicked.


Except (see above) you can't embed one form within another. If the new elements are to be part of an independent form, it must be outside the other form.

It's also a lot easier for the "new form" to already be there hidden, and to be shown only when needed, rather than trying to create the elements on-the-fly.
I found some pretty shells, some sea glass and this lovely tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 39184 times.
Similar Threads
leaves gap after inserting image.
values are not getting transferred from one servlet to another servlet
how to invoke method based on radio button select
struts2 tag produces unwanted tr and td tags which effects my design so it give rise to design issue
Submit popup
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 03:03:07.