This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

display data on same jsp page  RSS feed

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • 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: 257
15
Android Angular Framework AngularJS Java Spring
  • Mark post as helpful
  • send pies
  • 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
  • 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: 257
15
Android Angular Framework AngularJS Java Spring
  • Mark post as helpful
  • send pies
  • 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
  • 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...
 
Author and ninkuma
Marshal
Posts: 66783
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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: 257
15
Android Angular Framework AngularJS Java Spring
  • Mark post as helpful
  • send pies
  • 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
Author and ninkuma
Marshal
Posts: 66783
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!