bcarl314
09-16-2009, 11:00 PM
I'm using jqModal and jQuery for some modals in a new app I'm working on, all is going well, except when I have a form embedded in the modal. For some reason, when I check a checkbox, nothing happens. If I add an alert
<input type="checkbox" onclick="alert('huh???')" />
I see that the checkbox is checked, then the alert triggers, then the checkbox goes unchecked. It's really strange.
I'm adding the modals this way...
$().ready(function() { });
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}
function open_modal(open,close,link,target) {
alert(open);
$(open).jqm({overlay: 50, trigger: true, modal: true}).jqmAddTrigger(open).jqmAddClose(close)
$(link).click(function() {
$(target).jqmShow();
//$('div.square:odd').jqmHide();
return false;
});
}
Then in the HTML page...
addLoadEvent(function() {
open_modal('div.jqmWindow_1','div.jqmClose','#moduleLink_1','#module_1');
open_modal('div.jqmWindow_2','div.jqmClose','#moduleLink_2','#module_2');
open_modal('div.jqmWindow_3','div.jqmClose','#moduleLink_3','#module_3');
open_modal('div.jqmWindow_4','div.jqmClose','#moduleLink_4','#module_4');
open_modal('div.jqmWindow_5','div.jqmClose','#moduleLink_5','#module_5');
open_modal('div.jqmWindow_6','div.jqmClose','#moduleLink_6','#module_6');
open_modal('div.jqmWindow_7','div.jqmClose','#moduleLink_7','#module_7');
});
Then I have a series of divs as needed. And associated triggers.
<a href="#" id="moduleLink_1" class="jqModal">Open 1</a>
...
<div id="module_1" class="jqmWindow_1 modal_window large_modal_window">
...
</div>
...etc
Any ideas what the issue is here?
Using jQuery1.3.2.min and http://dev.iceburg.net/jquery/jqModal/
Thanks
<input type="checkbox" onclick="alert('huh???')" />
I see that the checkbox is checked, then the alert triggers, then the checkbox goes unchecked. It's really strange.
I'm adding the modals this way...
$().ready(function() { });
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}
function open_modal(open,close,link,target) {
alert(open);
$(open).jqm({overlay: 50, trigger: true, modal: true}).jqmAddTrigger(open).jqmAddClose(close)
$(link).click(function() {
$(target).jqmShow();
//$('div.square:odd').jqmHide();
return false;
});
}
Then in the HTML page...
addLoadEvent(function() {
open_modal('div.jqmWindow_1','div.jqmClose','#moduleLink_1','#module_1');
open_modal('div.jqmWindow_2','div.jqmClose','#moduleLink_2','#module_2');
open_modal('div.jqmWindow_3','div.jqmClose','#moduleLink_3','#module_3');
open_modal('div.jqmWindow_4','div.jqmClose','#moduleLink_4','#module_4');
open_modal('div.jqmWindow_5','div.jqmClose','#moduleLink_5','#module_5');
open_modal('div.jqmWindow_6','div.jqmClose','#moduleLink_6','#module_6');
open_modal('div.jqmWindow_7','div.jqmClose','#moduleLink_7','#module_7');
});
Then I have a series of divs as needed. And associated triggers.
<a href="#" id="moduleLink_1" class="jqModal">Open 1</a>
...
<div id="module_1" class="jqmWindow_1 modal_window large_modal_window">
...
</div>
...etc
Any ideas what the issue is here?
Using jQuery1.3.2.min and http://dev.iceburg.net/jquery/jqModal/
Thanks