• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 274
  • Last Modified:

ShowModal Dialog Question

I am opening the ShowModalWindow using Classic javascript.

I have a form inside that window.

one is cancel and other is submit buttons of that form..

I want to do close the modalwindow on click of cancel and if i click submit, it should save the data and return me the alert message and close close the window.

Cab anyone Javascript master Guide me

Thanks
0
Gurpreet Singh Randhawa
Asked:
Gurpreet Singh Randhawa
  • 2
  • 2
1 Solution
 
Easwaran ParamasivamCommented:
To close the window write window.close();

Have a Hiddden field, if the submit is succeeded then set some Flag for it. In the window.onbeforeunload() method write a function and check the flag there. If the flag is set (successfully submitted) then show an alert message.

http://msdn.microsoft.com/en-us/library/ms536907(v=vs.85).aspx

One more option there. From pop-up page to parent page you can send some RETURN values. Based on the return value, you can show the alert message in Parent page.

http://p2p.wrox.com/javascript/26755-return-value-showmodaldialog.html
0
 
Michel PlungjanIT ExpertCommented:
If you need to submit a form in a modaldialog, try using an iframe and target the form to that.
If it submits to same server, you can return a script that alerts and does a window.close()
0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
yes the way i am doing you said mplungjan, but the issue is when i click the close button, it shows me iheight issue!

can you tel me why
0
 
Michel PlungjanIT ExpertCommented:
What issue?
0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
resolved
thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now