Click to See Complete Forum and Search --> : amalgamating a javscript event


chris davies
10-23-2003, 05:41 AM
i'm trying to include the following onclick function -

onclick"windowHandle=window.open
('popupwin.html'myExample4','width=500,height=500');
windowHandle.focus();


into the following function

function gotoTermsByName(aTermsAction, aForm, aFieldname,
aFieldValueElement, anOptype, anOperator)
{
termsForm = aForm;
termsElement = aFieldValueElement;
var url = aTermsAction + "?f=" + aFieldname +
"&optype=" + (anOptype == null ? "default" : anOptype);

var curValue = termsForm[termsElement].value;
if (curValue != null && curValue != "")
{
var lastChar = curValue.charAt(curValue.length - 1);
if (lastChar != '*' && lastChar != '%')
{
curValue += "*";
}
url += "&c=" + escape(curValue);
if (anOperator != null && anOperator != "")
url += "&op=" + anOperator;
clearTermsElement = true;
}
termsWindow = window.open(url, termsWindowName,
"outerHeight=750,outerWidth=700,scrollbars=1,resizable=1");
}


what is the syntax for including the onlcik event into this function so that it opens a pop up window ? i take it that it involves changing the last two lines but i cant figure it out.

cheers

Khalid Ali
10-23-2003, 08:00 AM
window.open(url, termsWindowName,
"outerHeight=750,outerWidth=700,scrollbars=1,resiza
ble=1");

this line should open a ppup window,unless the code you created is not correct,

Make sure that

url, termsWindowName

both have valid code ion them

window name can not work if thre are some invalid characters or spaced in between

chris davies
10-23-2003, 10:07 AM
thanks its working - i was making it more complex for myself as always.

Khalid Ali
10-23-2003, 10:32 AM
:D
you are welcome