/    Sign up×
Community /Pin to ProfileBookmark

which event to use with dropdownlist

Hello

I have a javascript that disables two textboxes if a certain value is selected in a dropdownlist. My problem is I dont know which event of the dropdownlist to put the scriptcall. Ive tried OnSelectedIndexChanged,

[CODE]OnSelectedIndexChanged=”javascript:Hide()”[/CODE]

but I keep getting error messages when I run the page, looking for an example like this:Compiler Error Message: CS1026: ) expected

Can anyone tell me what I’m doing wrong?

/Regards

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@bathurst_guyDec 09.2005 — why not just use onchange or onclick
Copy linkTweet thisAlerts:
@TheBearMayDec 09.2005 — Hello

...Compiler Error Message: CS1026: ) expected
[/QUOTE]


Since when is JS compiled????
Copy linkTweet thisAlerts:
@livezauthorDec 09.2005 — onchange did the trick, thanks alot ? dont know why I got that message TheBearMay, but I got it with

OnSelectedIndexChanged="javascript:Hide()"

and didnt without it.
Copy linkTweet thisAlerts:
@KorDec 09.2005 — This is because the OnSelectedIndexChanged is a server-side event and tries to reach the server for calling a VB.net or a C#.net function. So that it acts rather like a .NET derived class. You can not call a client-side function via a server-side event.
Copy linkTweet thisAlerts:
@livezauthorDec 09.2005 — This is because the OnSelectedIndexChanged is a server-side event and tries to reach the server for calling a VB.net or a C#.net function. So that it acts rather like a .NET derived class. You can not call a client-side function via a server-side event.[/QUOTE]

ah ok, no wonder it didnt work. Thx for the info.
×

Success!

Help @livez 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 6.18,
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: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

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