Unable to focus on form field after opening modal

Here's my javascript code:


    $('modalLink').observe('click', function(event) {
        if ($('modalLink').className == 'active') {
            Control.Modal.open($('modalWindow').innerHTML,{
            afterOpen: function() {
                $('ModalName').focus();
            }
            });
        }
        else {
        }
    });

div#modalWindow has style="display:none;" and does contain input#ModalName, but the input is not focussing and I am getting this error (in IE):

"Can?t move focus to the control because it?s invisible not enabled or of a type that does not accept focus"

Please help!

Posted June 21st, 2007 at 10:02am by

Login or Register to Post