• 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

close pop up window after submit form

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

I have a parent page with "AddCash" button and a CashAvailable textfield.

On click of "AddCash" button, i open up a pop-up window and take in the cash to be added and click on the submit button.

On click of the submit button i call an action class which adds the current value with the previous value from the DB and this new calculated value should be displayed in my parent window in the CashAvailable textfield.

I am able to open up a pop-up window and call an aciton class, but the parent page gets reloaded in the pop-up window and does not get closed.

Here is my code:
parentpage:


pop-up window:


Where am i going wrong?

Thanks.

 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
and your window.close is where?

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

Eric Pascarello wrote:and your window.close is where?

Eric



Hey,


Thanks
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well document.forms.submit is wrong

should be document.formName.submit()
or
document.forms[0].submit()

And how can you close the same same window BEFORE you submit the page completely? You have a race condition. Will the form go out BEFORE the window closes? You need to close the window when the response comes back from the server.

Eric
 
Goodbye moon men. Hello tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic