Modal - Disable the Parent Window (Background) from use
I'm not sure of a standard way of doing this. The overlay is just a new element added to the page when the modal is opened, it doesn't have any effect on pre-existing elements.
The long method would be something like this before you've opened the modal (to avoid affecting elements in the modal itself).
$$('input').each(function(i) { i.disabled = 'disabled' });
Ben
Posted October 7th, 2007 at 3:56pm by bbodien
Ben, thanks for the reply. I'm not following where I would paste this code.
I currently have the following code.
new Control.Modal('modal_link_three');
// create your modal, storing a ref to it in myModalSignInRegister
var myModalSignInRegister = new Control.Modal('modal_link_one', {
// your modal properties here
});
// manually open myModalSignInRegister
myModalSignInRegister.open();
<input cols="70" rows="2" name="question" id="question" onkeyup="charCounter(this.value, 'Question', 150);" onblur="charCounter(this.value, 'Question', 150);" class="btn_ask_textarea" autocomplete="off" onclick="myModalSignInRegister.open();"/>
Can you help me understand where I would insert the disable code?
Thanks Again
Posted October 7th, 2007 at 4:14pm by nverfollowtt
Anyone else have any ideas?
Posted October 8th, 2007 at 5:47pm by nverfollowtt
Put it in just above your call to .open(). Note that this may disable inputs in the modal content as well, but you could reverse this quite easily after the modal has been opened.
Posted October 9th, 2007 at 6:59am by bbodien
how would I do that? Can you paste the code I should try? I'm not having much luck at this. THanks
Posted October 9th, 2007 at 12:39pm by nverfollowtt
Hello Everyone. I have implement Control.Modal to display a modal window prompting the user to login/register before asking a question on answers.nobosh.com... I have an input box with an onClick Load event, which triggers the modal window if the user is not logged in. The challenge I'm currently facing is that when the user clicks the input box to begin entering text, the modal window appears however, it does NOT prevent the user from continuing to type in the input box....... How can I disable the parent window? The parent window, which is grayed out should only server as a modal window close IMO... Thxs for any tips
Posted October 7th, 2007 at 1:24pm by nverfollowtt