This is a migrated thread and some comments may be shown as answers.

Input Fields No Longer Accepting Text on 2nd Window Open - IE7 and IE8 Compatibility Mode Only

2 Answers 43 Views
Window
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jeff
Top achievements
Rank 1
Jeff asked on 08 Nov 2011, 11:32 PM
Hi All - I'm seeing odd behavior in both IE7 and in IE8 compatibility mode around text input boxes on popup windows.  The first time opening a popup window, all works well.  After closing it and re-opening it, the text input boxes no longer accept text.   I do get the built in auto-complete functionality from IE though if I double-click in a box, so they are editable still.   It's almost as if something is preventing any keystrokes.

Window open code:

<input type="button" value="Popup" onclick="javascript:showDialogWindow('/Home/Popup');" />

<script type="text/javascript" 
    function showDialogWindow(url) {
        var windowElement = $.telerik.window.create({
            title: "Popup Window Issue",
            html: '<iframe src="' + url + '" frameborder="0" style="width:100%;height:100%"></iframe>',
            modal: true,
            resizable: true,
            draggable: true,
            width: 500,
            height: 300,
            onClose: function (e) {
                e.preventDefault();
                windowElement.data('tWindow').destroy();
            }
        });   
        windowElement.data('tWindow').center().open();
      
</script>

The window open code seems OK from looking at other posts.   Note that I am putting the action into an iframe, as the popup window will eventually need to post back to the server and remain open, displaying the results.

Attached is a small sample app with steps to re-produce.   I'm using the Q2 open source build (7/12).   Has anyone run across this?

Thanks,

Jeff

2 Answers, 1 is accepted

Sort by
0
Accepted
Alex Gyoshev
Telerik team
answered on 11 Nov 2011, 10:20 AM
Hello Jeff,

Input fields in general behave strange in IE7 / IE compat mode when placed in iframes. While most of the issues can be addressed with using JavaScript to focus them, this following scenario can be tackled by simply refreshing the iframe (instead of re-creating the window), like this:

function showDialogWindow(url) {
        var windowElement = $(".t-window");
        
        if (!windowElement.length) {
            windowElement = $.telerik.window.create({
                title: "Popup Window Issue",
                html: '<iframe src="' + url + '" frameborder="0" style="width:100%;height:100%"></iframe>',
                modal: true,
                resizable: true,
                draggable: true,
                width: 500,
                height: 300
            });
        } else {
            var iframe = windowElement.find("iframe")[0];
            iframe.src = url;

        }

        windowElement.data('tWindow').center().open();
    }

Regards,
Alex Gyoshev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Jeff
Top achievements
Rank 1
answered on 11 Nov 2011, 03:26 PM
Thanks!  That fixed it - I spent a lot of time on this and had no idea where to go next.  You guys are great.  :-)
Tags
Window
Asked by
Jeff
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Jeff
Top achievements
Rank 1
Share this question
or