/    Sign up×
Community /Pin to ProfileBookmark

How can I disable mouse events after an event?

Hi all, first post.

I’m new to javascript, though I’m a PHP/AS coder and know what I want my java to do.

I have a bit of text which, onClick, populates a form field. However, if the user chooses to delete that bit of text (which represents a client from a list of clients) obviously I don’t want that text to do anything anymore when clicked.

I can make it *look* like it’s vanished, i.e. by changing the span colour, but any mouse events are still active. Is there a way to die() all further functions or disable specific ones?

I hope this makes sense- thanks in advance.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@CharlesOct 01.2003 — [font=georgia]Just add to the handler [font=monospace]this.onclick = function () {}[/font].[/font]
Copy linkTweet thisAlerts:
@mityaauthorOct 01.2003 — THanks for that, that's great.
Copy linkTweet thisAlerts:
@lacroix13May 27.2005 — another way is to set the following on the text field

[INDENT]onFocus=this.blur();[/INDENT]
×

Success!

Help @mitya 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.3,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

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