• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Posting a form to a hidden frame in the same page

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a page called resourceframset.jsp which contains two frames. The first contains a hidden page called myAdd.jsp the second a page called resourceAdd.jsp. The resourceAdd.jsp contains a form called resourceAddForm which I want to post to the hidden myAdd.jsp to insert a record to the database and then refresh the resourceAdd.jsp to display the results dynamically. can I do this? I can't seem to get my resourceAddForm to post to the myAdd hidden frame. I have this line in the form field.



When I click on the Add button I call this function



but when I click the add button the page opens up a new copy of resourceAdd.jsp and nothing is passed to myAdd.

Connie
 
Sheriff
Posts: 67752
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
Moved to the HTML forum.
 
Bear Bibeault
Sheriff
Posts: 67752
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

which I want to post to the hidden myAdd.jsp



You don't post to pages, you post to windows/frames.

to insert a record to the database and then refresh the resourceAdd.jsp to display the results dynamically



Why all the frames? If you are going to refresh the page with the form on it, why not just submit the page in-place and refresh it like any other web application? It seems like you're going out of your way to make it complicated for no reason.

There are a lot of problems with your code, but before addressing them, let's resolve the frame issue since getting rid of the frames if possible will vastly simplify everything.
 
Connie Kamrowski
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks Bear,

Ok well I have my page which is resourceAdd.jsp, it has two forms in it and is working OK, and origionally I was posting it to a display page and then coming back to my page with a refresh but my manager has said he wants it all in the same page. I have not had a lot to do with web programming, I did java at Uni about 3 years ago and am a little rusty but getting there. I will post my Original page code and maybe you could suggest a better way to go about this. Thanks for your help



and in the resourceDisplay Page I had the following
(from memory)

and this was working OK. Inserting records fine.

But now the boss wants this to be in the page and have the details entered in the top form resourceAddForm to be submitted and display in the displaytag projectResourceListForm list when entered as I had no idea how to go about this I consulted some superiors and a few books and thought frames were my only option.
 
Bear Bibeault
Sheriff
Posts: 67752
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

But now the boss wants this to be in the page



I really don't know what you mean by this at all.

Why not back up a little, explain what the current page does, and how it needs to be different. Whatever that is, I can tell you that frames are not your answer.
 
Connie Kamrowski
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry bear,

The page has two parts, The top part takes details of a new resource which you need to add to a project. The bottom part lists all resources already added to the project. you can add the new details to a project. You can select a record for an existing resource in the 2nd part and edit it or delete it from the project. I originally opened a new page to display the added record, and also a new page to edit the existing.

My boss now wants the added record to update into the list straight away and similarly if you are editing a record the edit should be done where you would normally add a record.

does that make sense?
 
Connie Kamrowski
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please ignore this question.

I went back to my original files and tried it again with just a post to self and now it is working fine. I think I may be guilty of getting frustrated with myself and thinking I had a problem when I didn't.

Thankyou for your efforts to help Bear and I am sorry for any inconvenience I caused you.

Connie
 
Bear Bibeault
Sheriff
Posts: 67752
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
If you learned something from this, it was well worth the time!
 
They gave me pumpkin ice cream. It was not pumpkin pie ice cream. Wiping my tongue on this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic