/    Sign up×
Community /Pin to ProfileBookmark

amalgamating a javscript event

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

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliOct 23.2003 — 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
Copy linkTweet thisAlerts:
@chris_daviesauthorOct 23.2003 — thanks its working - i was making it more complex for myself as always.
Copy linkTweet thisAlerts:
@Khalid_AliOct 23.2003 — ?

you are welcome
×

Success!

Help @chris_davies spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...