Popup modal window over a canvas for user to input data html and java script

Viewed 12

I would like to be able to open a "modal" popup window for the user to enter data in few fields, after a click on certain points on a canvas.

I have already the html design of the window and I also have the initial data from the server using an ajax.

Now I need to be able to display that html page on the popup window and allow the user to enter responses, but in a way, so that the user cannot access anything else on the canvas until the user clicks on the close button on that window.

Any help or pointers will be appreciated.

I would like to add that I searched for hours and could not find an example that answer my need.

1 Answers

I ended up doing it myself and not relying on any property of CSS or windows.

I have a defined a global variable that tells me whether the popup is visible or not. Then in all the mouse events that I capture I check that variable and if it is true I ignore the event, returning false.

Also, if any submit button outside the popup is clicked I ignore it, returning false (remember to define the onclick of the buttons to check the return value, such that <... onclick = "return my_click()" >)

Related