Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #35817

Re: Is there a control for this?

Newsgroups comp.lang.javascript
Subject Re: Is there a control for this?
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <3ddf0501-7d86-4862-b47c-4220cd79732e@googlegroups.com>
Date 2018-11-15 16:51 +0100
Message-ID <XnsA99BAB84B81E1eejj99@194.109.6.166> (permalink)

Show all headers | View raw


dr.j.r.stockton@gmail.com wrote on 15 Nov 2018 in comp.lang.javascript:

> I have several controls, to be all alike, and the first has
> been upgraded to (with these 3 inputs on ONE line) :-
> 
> L
> <input type=button value="-" onclick="this.nextSibling.value--;Draw()">
> <input name=L type=text size=4 value=13>
> <input type=button value="+" onclick="this.previousSibling.value++;Draw
()">
> One of the effects of Draw() is reading the control.

This only works in modern browsers, 
if the source-code[!] is not split in multiple lines 
in a way that generate empty text nodes, 
and 
I would want to know which node and 
with what value draw() receives,
so try:

======================

<script>
const drawIt = (t) => {
	if (t.value=='+') {
		t.previousSibling.value++;
	} else {
    		t.nextSibling.value--;
	};
    	draw(t);
};
</script>

<input type=button value="-" onclick="drawIt(this);"
><input id='result1' size=4 value=13 readonly
><input type=button value="+" onclick="drawIt(this);">

===========
 
> Is there a better approach nowadays - a single control element,
> perhaps?  It must accept typed values in L, and a slider would
> either be too long or give insufficient resolution.

<input type="number" value="13" step="1" onmouseup="draw(this)">

However, see: <https://caniuse.com/#search=input%20type>
 
> FYI, I hope to adjust the above onclicks so that they ALL are
> "Nudge(this, Bool)" where Bool means previous or next; or even
> make it look both ways for its numeric input control.

See above 



-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Is there a control for this? dr.j.r.stockton@gmail.com - 2018-11-15 04:43 -0800
  Re: Is there a control for this? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-11-15 15:49 +0000
  Re: Is there a control for this? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-11-15 16:51 +0100
    Re: Is there a control for this? dr.j.r.stockton@gmail.com - 2018-11-15 10:17 -0800
      Re: Is there a control for this? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-11-15 23:19 +0100
        Re: Is there a control for this? dr.j.r.stockton@gmail.com - 2018-11-16 03:49 -0800
          Re: Is there a control for this? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-11-16 12:58 +0100
            Re: Is there a control for this? dr.j.r.stockton@gmail.com - 2018-11-16 10:51 -0800
              Re: Is there a control for this? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-11-16 22:33 +0100
                Re: Is there a control for this? dr.j.r.stockton@gmail.com - 2018-11-17 03:26 -0800
                Re: Is there a control for this? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-11-17 21:59 +0100
                Re: Is there a control for this? dr.j.r.stockton@gmail.com - 2018-11-18 06:29 -0800
                Re: Is there a control for this? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-11-18 15:44 +0000
    Re: Is there a control for this? Gloops <gloops@zailes.invalid.org.invalid> - 2018-11-18 10:35 +0100
      Re: Is there a control for this? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-11-18 11:32 +0100
        Re: Is there a control for this? Gloops <gloops@zailes.invalid.org.invalid> - 2018-11-29 17:08 +0100
      Re: Is there a control for this? dr.j.r.stockton@gmail.com - 2018-11-18 05:37 -0800
      Re: Is there a control for this? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-11-18 17:13 +0100
        Re: Is there a control for this? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-11-18 21:28 +0100
          Re: Is there a control for this? dr.j.r.stockton@gmail.com - 2018-11-19 02:51 -0800

csiph-web