• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

display data on same jsp page

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



This is additem.jsp

Screenshot_1.png
[Thumbnail for Screenshot_1.png]
This is my jsp page.
Screenshot_2.png
[Thumbnail for 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?
 
Ranch Hand
Posts: 270
15
Android Angular Framework Spring AngularJS Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@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.
 
sarojni agrwal
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
[Thumbnail for Screenshot_3.png]
this is gold.jsp
 
L Foster
Ranch Hand
Posts: 270
15
Android Angular Framework Spring AngularJS Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
sarojni agrwal
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
L Foster
Ranch Hand
Posts: 270
15
Android Angular Framework Spring AngularJS Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic