Javascript button on click event

Hi all, i have a pop up page with ok button for which i amusing javascript button widget. this button has function to open a link. this works fine. but i want the pop up page to be closed on click of the button like it happens with the action buttons using the onclick property .
1 answers

Hi Jammula,

You can go to the properties of the button and select the onclick as "Close page". I think this should work fine because the actual OnClick - directing to a link is handled by your JS. 


PS: I would recommend you to first research on ways to implement the same functionality within Mendix first before of opting for JS code manipulation. Good Luck!


EDIT:  Please try the below steps and let us know if this what is expected.


1. In your page add a Action Button with 'OnClick' value as "Close page" and 'Class' as "TestButton"

2. Add a HTML snippet (bottom of the page preferably) if not done already. 

3. Add the below JS code replacing the link with your URL.

$('.TestButton').bind('click', function() 

3. Modify the params based on your requirements, to open URL in the same tab or a new tab etc. etc.