/    Sign up×
Community /Pin to ProfileBookmark

Textarea MouseDown

Hi there,

is it possible to distinguish the mouse-event of the “scroll up” and “scroll down” in a textarea.

I have a textarea which consists of one visible row, but many entries. As soon as the user scrolls up or down to select another value (see attached image), I need to get this value selected. Otherwise it won’t send it with the form.

Any idea? Thanks for any help,

Luftikus

[upl-file uuid=8a13d34c-c99f-4fc2-ac67-8558218df0d4 size=2kB]textarea.png[/upl-file]

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@FangSep 20.2004 — Why not use a [I]select[/I] instead of a [I]textarea[/I]?
Copy linkTweet thisAlerts:
@LuftikusauthorSep 20.2004 — I didn't want to have a drop-down menu...
Copy linkTweet thisAlerts:
@FangSep 20.2004 — This is probably an easier way:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>fake select</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
<!--
function Selection(dir) {
var num=parseInt(document.getElementById('StdDev').value);
document.getElementById('StdDev').value=(dir)? ++num : --num;
}
//-->
</script>

<style type="text/css">
<!--
button {cursor: pointer;}
-->
</style>

</head>
<body>
<input type="text" value="10" size="1" id="StdDev" onfocus="blur();" />
<button type="button" onclick="Selection(1);">↑</button>
<button type="button" onclick="Selection(0);">↓</button>
</body>
</html>
Copy linkTweet thisAlerts:
@LuftikusauthorSep 21.2004 — Thanks a lot. Looks quite nice. Perhaps I gonna replace the buttons by images for "simulating" the "<" and ">" as ups and downs.

Bye.
×

Success!

Help @Luftikus 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.19,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

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