...

View Full Version : How to pass a value to add to the url of a pop-up window



kieboy
11-10-2004, 07:58 AM
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. :(

LynxGrr
11-10-2004, 09:48 AM
function changeProperties(myVar) {
var objWindow;

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

kieboy
11-11-2004, 07:32 AM
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');
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum