• 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

Problem with the Pop up window

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have a pop up window coming on click of a button. There is submit button on the pop up and 3 text boxes. If I enter the value in the text boxes and hit submit button, the desired operation is working properly. But the action is call even when I close the pop up window, need to avoid that. Please find the scripts.

The script which is called from the parent window for the pop up is
function popUpPostPayment(){
var popUpPostPayment="dialogHeight: " + 200 + "px;dialogWidth: " + 460 + "px;";
window.showModalDialog("/Cola/jsp/tile/ColaPostPaymentTile.jsp",window,popUpPostPayment);
return false;
}

And the submit button's onclick even will call the script

function closePostPaymentPopUp(){
alert("test");
var parentWindow=window.dialogArguments;
parentWindow.document.getElementById("strTransactionType").value=document.getElementById("strTransactionType").value;
parentWindow.document.getElementById("strCustomerPaymentDate").value=document.getElementById("strCustomerPaymentDate").value;
parentWindow.document.getElementById("strTransactionAmount").value=document.getElementById("strTransactionAmount").value;

self.close();
parentWindow.document.forms[0].action="ColaPostPayment.action";
return false;
}


Please let me know how to avoid the action call when I close the pop up window.

Regards,
Bharath.S
 
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
Please take the time to choose the correct forum for your posts. This forum is for questions on JSP.

For more information, please read this.

This post has been moved to a more appropriate forum.

 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Think about the two lines above in a none coding way.

You are closing the door [self.close()] before walking through it [setting the action].

Eric


 
reply
    Bookmark Topic Watch Topic
  • New Topic