Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Feb 2007
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile window.open problem in IE

    Hi guys & gals,

    got a problem with this bit of script...

    ----------------------------------------------------------------

    <script language="JavaScript"><!--
    function myOpenWindow(str) {
    myurl = 'view.asp?callbackID=' + str
    myWindowHandle = window.open(myurl,'CB or Action','width=600,height=600,scroll=auto');
    eval('document.view' + str + '.submit()');
    }
    //-->
    </script>

    <form name="view<%=(rsActions.Fields.Item("callbackID").Value)%>" action="../clients/viewdetails.asp">
    <div align="right">
    <input type="submit" name="Submit" value="Go To" onClick="myOpenWindow(<%=(rsActions.Fields.Item("callbackID").Value)%>)">
    <input name="callbackID" type="hidden" id="callbackID" value="<%=(rsActions.Fields.Item("callbackID").Value)%>">
    <input name="action" type="hidden" id="action" value="<%=request("action")%>">
    <input name="sd_to" type="hidden" id="sd_to" value="<%=request("sd_to")%>">
    <input name="sd_from" type="hidden" id="sd_from" value="<%=request("sd_from")%>">
    <input name="searchdate" type="hidden" id="searchdate" value="<%=request("searchdate")%>">
    <input name="clientID" type="hidden" id="clientID" value="<%=(rsActions.Fields.Item("clientID").Value)%>">
    </div>
    </form>

    ----------------------------------------------------------------

    now the script works great in FireFox, then new window opens and the form is submitted which takes you to the next page. However trying this in IE it doesnt work??

    Any ideas why or how to do a cross browser fix??

    thanks

    loz

  • #2
    Regular Coder riptide's Avatar
    Join Date
    Jan 2007
    Posts
    143
    Thanks
    1
    Thanked 0 Times in 0 Posts
    why do you have all those hidden input types.

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    The name parameter in window.open needs to not have spaces in it.
    Code:
    myWindowHandle = window.open(myurl,'CB_or_Action','width=600,height=600,scroll=auto');
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #4
    New Coder
    Join Date
    Feb 2007
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    many thanks, that fixed it a treat!

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    It's not good to use eval. Change this:

    Code:
    eval('document.view' + str + '.submit()');
    to:

    Code:
    document.forms["view" + str].submit();
    See the square bracket notation in my sig for more info on it.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •