JavaScript Question

Last post 07-23-2008 6:18 PM by kabir.khan.net. 8 replies.

Sort Posts:

  • JavaScript Question

    07-23-2008, 12:01 PM

    hi all,

                  I am calling a javasript funciton that will open a new popup style window, however i want to pass a few parameter as a query string of the new window which will contain a specific data depending on what user have chosen. I have a label in my parent window that contains a data that i want to pass along to the new popup window. I have been able to achieve how to open a new popup window without all the toolbars, status bar , etc but find the lable here is what i use. It process the page but give be "Object Required" code 0 error

    var OAASIDHiddenField = document.getElementById("OAA_SIDHF");       
    url = url + '?OAA_SID=' + OAASIDHiddenField.text + ';';

    But once i add that two line to my code the popup windows stop appearing.... below is the rest of the code ...

    function wopen(url, name, w, h)
        {
            // Fudge factors for window decoration space.
            // In my tests these work well on all platforms & browsers.
            w += 32;
            h += 96;
            wleft = (screen.width - w) / 2;
            wtop = (screen.height - h) / 2;
            // IE5 and other old browsers might allow a window that is
            // partially offscreen or wider than the screen. Fix that.
            // (Newer browsers fix this for us, but let's be thorough.)
            if (wleft < 0)
            {
                w = screen.width;
                wleft = 0;
            }
            if (wtop < 0)
            {
                h = screen.height;
                wtop = 0;
            }
           
            var OAASIDHiddenField = document.getElementById("OAA_SIDHF");       
            //url = url + '?OAA_SID=' + OAASIDHiddenField.text + ';';
           
            var win = window.open(url,
            name,
            'width=' + w + ', height=' + h + ', ' +
            'left=' + wleft + ', top=' + wtop + ', ' +
            'location=no, menubar=no, modal=yes' +
            'status=yes, toolbar=no, scrollbars=no, resizable=no', 'title=no', 'resizable=no', 'directories=no', 'status=yes');
            // Just in case width and height are ignored
            win.resizeTo(w, h);
            // Just in case left and top are ignored
            win.moveTo(wleft, wtop);
            win.focus();
        }

      

     

     

     

     

  • Re: JavaScript Question

    07-23-2008, 12:18 PM
    • Loading...
    • rjv_rnjn
    • Joined on 04-01-2008, 8:35 PM
    • Posts 14

     Try OAASIDHiddenField.value instead of OAASIDHiddenField.text.

  • Re: JavaScript Question

    07-23-2008, 12:37 PM

    Thanks, I have tried that as well did not work !

  • Re: JavaScript Question

    07-23-2008, 12:51 PM
    • Loading...
    • rjv_rnjn
    • Joined on 04-01-2008, 8:35 PM
    • Posts 14

     Do you have a master page here? Also, try to debug the script at this line and look into quick watch window if the value of OAASIDHiddenField is Nothing. If it is so and this page is not in a master page then one of the possible reasons could be a spelling mistake (case sensitive) in the variable name in JS and in ASPX page. Just one of the possibilities.

  • Re: JavaScript Question

    07-23-2008, 12:58 PM

    How about .innerHtml instead of .text?

    We're all in this together.
  • Re: JavaScript Question

    07-23-2008, 1:06 PM

    Thanks for the response! I do have a master page involved how do you debug script, I have also check the cases and spelling they are all good no error there...???

  • Re: JavaScript Question

    07-23-2008, 1:27 PM

    i have tried this and it does not work either....

    var OAA_SIDIVLbl = $get('<%= me.OAA_SIDIVLbl.ClientID %>');        
    url = url + '?OAA_SID=' + OAA_SIDIVLbl.innerHTML; 
    I just dont get it, is there anything else i could do.  

     

     

  • Re: JavaScript Question

    07-23-2008, 1:58 PM
    • Loading...
    • rjv_rnjn
    • Joined on 04-01-2008, 8:35 PM
    • Posts 14

     If you have master page do this

    var OAASIDHiddenField = document.getElementById('<%= OAA_SIDHF.ClientId'%>);  
    alert(OAASIDHiddenField.value);

  • Re: JavaScript Question

    07-23-2008, 6:18 PM
    Answer

    Thanks but Do what you did not give me any information. Anyway i have figured it out through debuggin, i just need to use the defaultValue instead of value that does it for me.

Page 1 of 1 (9 items)
Microsoft Communities
Page view counter