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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Nov 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy How to pass a value to add to the url of a pop-up window

    Hi I really need help in this problem of mine I have a link that calls a JS function, here's the code:

    DataNavigateUrlFormatString="javascript:changeProperties(id={0})"

    what I want to do is just pass the id value to the window.open url

    function changeProperties() {
    var objWindow;

    objWindow = window.open('Details.aspx?id=' , 'null',' status=yes,scrollbars=yes,resizable=yes');
    }

    So that the url of the page would be:

    Details.aspx?id=valueofID

    Hope you guys can help me here, I tried finding the solutions myslef but had no luck.

  • #2
    New Coder
    Join Date
    May 2004
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    function changeProperties(myVar) {
    var objWindow;
    
    objWindow = window.open('Details.aspx?id=' + myVar , 'null',' status=yes,scrollbars=yes,resizable=yes');
    }
    "The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect."

    --Tim Berners-Lee, W3C Director and Inventor of the World Wide Web

  • #3
    New to the CF scene
    Join Date
    Nov 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the code, yep that worked fine. I just have a question. Is it psossible for a window, to change its properties by itself when the it is loaded? I mean there will be no opener for it. Will the onload property work? Thanks again for the help


    function changeProperties() {
    var objWindow;

    objWindow = window.Onload('Details.aspx?id=' + myVar , 'null','
    status=yes,scrollbars=yes,resizable=yes');
    }


  •  

    Posting Permissions

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