Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #15413 > unrolled thread
| Started by | emf <emfril@gmail.com> |
|---|---|
| First post | 2012-08-18 10:03 -0400 |
| Last post | 2012-09-04 06:00 -0700 |
| Articles | 20 on this page of 37 — 6 participants |
Back to article view | Back to comp.lang.javascript
radio buttons with. checkbox emf <emfril@gmail.com> - 2012-08-18 10:03 -0400
Re: radio buttons with. checkbox SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-08-18 17:36 +0200
Re: radio buttons with. checkbox emf <emfril@gmail.com> - 2012-08-19 09:30 -0400
Re: radio buttons with. checkbox emf <emfril@gmail.com> - 2012-08-19 12:11 -0400
Re: radio buttons with. checkbox SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-08-20 14:00 +0200
Re: radio buttons with. checkbox emf <emfril@gmail.com> - 2012-08-20 09:05 -0400
Re: radio buttons with. checkbox SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-08-20 16:11 +0200
Re: radio buttons with. checkbox emf <emfril@gmail.com> - 2012-08-21 05:25 -0400
Re: radio buttons with. checkbox Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-08-21 14:36 +0200
Re: radio buttons with. checkbox SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-08-22 12:24 +0200
Re: radio buttons with. checkbox SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-08-20 12:13 +0200
Re: radio buttons with. checkbox Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-08-20 16:27 +0200
Re: radio buttons with. checkbox SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-08-20 21:58 +0200
Re: radio buttons with. checkbox emf <emfril@gmail.com> - 2012-08-21 10:58 -0400
Re: radio buttons with. checkbox Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-08-22 10:41 +0200
Re: radio buttons with. checkbox "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-08-22 10:14 +0000
Re: radio buttons with. checkbox SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-08-22 14:31 +0200
Re: radio buttons with. checkbox Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-08-18 19:18 +0200
Re: radio buttons with. checkbox emf <emfril@gmail.com> - 2012-08-20 08:29 -0400
Re: radio buttons with. checkbox Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-08-20 16:25 +0200
Re: radio buttons with. checkbox emf <emfril@gmail.com> - 2012-08-21 06:06 -0400
Re: radio buttons with. checkbox Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-08-21 14:33 +0200
Re: radio buttons with. checkbox emf <emfril@gmail.com> - 2012-08-21 10:51 -0400
Re: radio buttons with. checkbox Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-08-22 11:42 +0200
Re: radio buttons with. checkbox SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-08-22 14:27 +0200
Re: radio buttons with. checkbox Dr J R Stockton <reply1234@merlyn.demon.co.uk.invalid> - 2012-08-22 20:24 +0100
Re: radio buttons with. checkbox Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-08-23 11:06 +0200
Re: radio buttons with. checkbox Dr J R Stockton <reply1234@merlyn.demon.co.uk.invalid> - 2012-08-25 17:01 +0100
Re: radio buttons with. checkbox Dr J R Stockton <reply1234@merlyn.demon.co.uk.invalid> - 2012-08-22 19:58 +0100
Re: radio buttons with. checkbox emf <emfril@gmail.com> - 2012-08-22 02:20 -0400
Re: radio buttons with. checkbox Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-08-22 10:44 +0200
Re: radio buttons with. checkbox SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-08-22 14:40 +0200
Re: radio buttons with. checkbox emf <emfril@gmail.com> - 2012-08-26 00:16 -0400
Re: radio buttons with. checkbox emf <emfril@gmail.com> - 2012-09-03 07:19 -0400
Re: radio buttons with. checkbox David Mark <dmark.cinsoft@gmail.com> - 2012-09-03 21:02 -0700
Re: radio buttons with. checkbox Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-09-04 13:44 +0200
Re: radio buttons with. checkbox David Mark <dmark.cinsoft@gmail.com> - 2012-09-04 06:00 -0700
Page 1 of 2 [1] 2 Next page →
| From | emf <emfril@gmail.com> |
|---|---|
| Date | 2012-08-18 10:03 -0400 |
| Subject | radio buttons with. checkbox |
| Message-ID | <k0o75t$iac$1@speranza.aioe.org> |
In my Spherical Triangle Calculator:
https://files.nyu.edu/emf202/public/js/spherical.html
one can select 1 of 3 radio buttons. Degrees and Radians affect the
input and the output, while degmin affects the output only.
I considered making the deg°min' a checkbox instead:
https://files.nyu.edu/emf202/public/js/spherical2.html
but there are problems with the code. To begin with, if you click
Radians, the degmin checkbox *is* disabled, but then when I click Clear
while the Degrees is selected the degmin remains disabled. Also, I'd
prefer if the radio buttons and the checkbox are outside the dataForm,
so their settings won't change with Clear, but then when clicking
Calculate, it should be able to tell the current status of the
buttons/checkbox.
spherical2 is more logical, but is there a straightforward way to make
it work as it should?
emf
P.S. The defective code in spherical2 is:
...
var using = ".###°";
function inputOutput(format) {
if (format === 0) {
document.dataForm.dgmn.disabled = true;
using = "r";
}
else if (format === 1) {
document.dataForm.dgmn.disabled = false;
using = ".###°";
}
else { using = "#°##.#'"; }
}
...
<label for="rads" style="padding-right:1em;">
<input type="radio" name="formats"
onClick="inputOutput(0)";> Radians
</label>
<label for="degr" style="padding-right:1em;">
<input type="radio" name="formats"
onClick="inputOutput(1)"; checked> Degrees
</label>
<label for="dgmn2" style="padding-right:1em;">
<input type="checkbox" name="dgmn"
onClick="inputOutput(2)"> deg°min'
</label>
...
--
Date Calculator with all-purpose JS code
https://files.nyu.edu/emf202/public/js/dateCalculator.html
[toc] | [next] | [standalone]
| From | SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> |
|---|---|
| Date | 2012-08-18 17:36 +0200 |
| Message-ID | <502fb66c$0$6212$ba4acef3@reader.news.orange.fr> |
| In reply to | #15413 |
Le 18/08/12 16:03, emf a écrit :
> In my Spherical Triangle Calculator:
> I considered making the deg°min' a checkbox instead:
>
> https://files.nyu.edu/emf202/public/js/spherical2.html
if (using !== "r") {
a = (a0 !== x)? rad(a0) : a0;
ab = (ab0 !== x)? rad(ab0) : ab0;
> but there are problems with the code. To begin with, if you click
> Radians, the degmin checkbox *is* disabled, but then when I click Clear
> while the Degrees is selected the degmin remains disabled.
<input type ="reset" onclick="dgmn.disabled=0" value="Clear">
Also, I'd
> prefer if the radio buttons and the checkbox are outside the dataForm,
> so their settings won't change with Clear, but then when clicking
> Calculate, it should be able to tell the current status of the
> buttons/checkbox.
>
> spherical2 is more logical, but is there a straightforward way to make
> it work as it should?
logical ... logical ... fast said !
deg°min' would have to be displayed only if degrees are checked, no ?
> P.S. The defective code in spherical2 is:
I allways get "invalid entry" ... !!!
What numbers could I enter ?
var using = "#°##.#'";
function inputOutput() {
var format = document.dataForm.formats.value,
degMin = document.dataForm.dgmn.checked;
document.dataForm.dgmn.disabled = (format === 0);
using = format === 0? "r" : degMin? "#°##.#'" : ".###°";
}
...
<label for="rads" style="padding-right:1em;">
<input type="radio" name="formats" id="rads"
value="0" onClick="inputOutput()";> Radians
</label>
<label for="degr" style="padding-right:1em;">
<input type="radio" name="formats" id="degr"
value="1" onClick="inputOutput()"; checked> Degrees
</label>
<label for="dgmn2" style="padding-right:1em;">
<input type="checkbox" name="dgmn" id="dgmn2"
onClick="inputOutput()"> deg°min'
</label>
--
Stéphane Moriaux avec/with iMac-intel
[toc] | [prev] | [next] | [standalone]
| From | emf <emfril@gmail.com> |
|---|---|
| Date | 2012-08-19 09:30 -0400 |
| Message-ID | <k0qpjr$6s8$1@speranza.aioe.org> |
| In reply to | #15417 |
On 2012-08-18 11:36 SAM wrote:
> Le 18/08/12 16:03, emf a écrit :
>> In my Spherical Triangle Calculator:
>> I considered making the deg°min' a checkbox instead:
>>
>> https://files.nyu.edu/emf202/public/js/spherical2.html
>
>
> if (using !== "r") {
> a = (a0 !== x)? rad(a0) : a0;
> ab = (ab0 !== x)? rad(ab0) : ab0;
I should have thought of that.
>> but there are problems with the code. To begin with, if you click
>> Radians, the degmin checkbox *is* disabled, but then when I click Clear
>> while the Degrees is selected the degmin remains disabled.
>
> <input type ="reset" onclick="dgmn.disabled=0" value="Clear">
Thanks.
>
> Also, I'd
>> prefer if the radio buttons and the checkbox are outside the dataForm,
>> so their settings won't change with Clear, but then when clicking
>> Calculate, it should be able to tell the current status of the
>> buttons/checkbox.
>>
>> spherical2 is more logical, but is there a straightforward way to make
>> it work as it should?
>
> logical ... logical ... fast said !
> deg°min' would have to be displayed only if degrees are checked, no ?
Interesting idea. I've been changing the code to make it disappear
instead of get disabled.
>
>> P.S. The defective code in spherical2 is:
>
> I allways get "invalid entry" ... !!!
> What numbers could I enter ?
Try for A, AB, B: 80, 100, 120 degrees or 1, 2, 3 radians. Or, more
interesting, A, B, BC 80, 120, 76.33.
Or even:
A: Paris 48.75N 2.33E
B: North Pole 90N
C: New York 40.75N -74W
AB = 90 - 48.75 = 31.25
B = 74 + 2.33 = 76.33
BC = 90 - 40.75 = 49.25
CA = NY to Paris
(and, or course, distance = CA * 40000 / 360 km)
> var using = "#°##.#'";
>
> function inputOutput() {
> var format = document.dataForm.formats.value,
> degMin = document.dataForm.dgmn.checked;
> document.dataForm.dgmn.disabled = (format === 0);
> using = format === 0? "r" : degMin? "#°##.#'" : ".###°";
> }
> ...
> <label for="rads" style="padding-right:1em;">
> <input type="radio" name="formats" id="rads"
> value="0" onClick="inputOutput()";> Radians
> </label>
> <label for="degr" style="padding-right:1em;">
> <input type="radio" name="formats" id="degr"
> value="1" onClick="inputOutput()"; checked> Degrees
> </label>
> <label for="dgmn2" style="padding-right:1em;">
> <input type="checkbox" name="dgmn" id="dgmn2"
> onClick="inputOutput()"> deg°min'
> </label>
The code doesn't work as expected but I'll work on it.
emf
--
It ain't THAT, babe! - A radical reinterpretation
https://files.nyu.edu/emf202/public/bd/itaintmebabe.html
[toc] | [prev] | [next] | [standalone]
| From | emf <emfril@gmail.com> |
|---|---|
| Date | 2012-08-19 12:11 -0400 |
| Message-ID | <k0r30j$t06$1@speranza.aioe.org> |
| In reply to | #15451 |
On 2012-08-19 09:30 emf wrote:
> On 2012-08-18 11:36 SAM wrote:
>> Le 18/08/12 16:03, emf a écrit :
>>> In my Spherical Triangle Calculator:
>>> I considered making the deg°min' a checkbox instead:
>>>
>>> https://files.nyu.edu/emf202/public/js/spherical2.html
>>
>>
>> if (using !== "r") {
>> a = (a0 !== x)? rad(a0) : a0;
>> ab = (ab0 !== x)? rad(ab0) : ab0;
>
> I should have thought of that.
>
>>> but there are problems with the code. To begin with, if you click
>>> Radians, the degmin checkbox *is* disabled, but then when I click Clear
>>> while the Degrees is selected the degmin remains disabled.
>>
>> <input type ="reset" onclick="dgmn.disabled=0" value="Clear">
>
> Thanks.
>>
>> Also, I'd
>>> prefer if the radio buttons and the checkbox are outside the dataForm,
>>> so their settings won't change with Clear, but then when clicking
>>> Calculate, it should be able to tell the current status of the
>>> buttons/checkbox.
>>>
>>> spherical2 is more logical, but is there a straightforward way to make
>>> it work as it should?
>>
>> logical ... logical ... fast said !
>> deg°min' would have to be displayed only if degrees are checked, no ?
>
> Interesting idea. I've been changing the code to make it disappear
> instead of get disabled.
>
>>
>>> P.S. The defective code in spherical2 is:
>>
>> I allways get "invalid entry" ... !!!
>> What numbers could I enter ?
>
> Try for A, AB, B: 80, 100, 120 degrees or 1, 2, 3 radians. Or, more
> interesting, A, B, BC 80, 120, 76.33.
>
> Or even:
>
> A: Paris 48.75N 2.33E
> B: North Pole 90N
> C: New York 40.75N -74W
>
> AB = 90 - 48.75 = 31.25
> B = 74 + 2.33 = 76.33
> BC = 90 - 40.75 = 49.25
> CA = NY to Paris
> (and, or course, distance = CA * 40000 / 360 km)
>
>> var using = "#°##.#'";
>>
>> function inputOutput() {
>> var format = document.dataForm.formats.value,
>> degMin = document.dataForm.dgmn.checked;
>> document.dataForm.dgmn.disabled = (format === 0);
>> using = format === 0? "r" : degMin? "#°##.#'" : ".###°";
>> }
>> ...
>> <label for="rads" style="padding-right:1em;">
>> <input type="radio" name="formats" id="rads"
>> value="0" onClick="inputOutput()";> Radians
>> </label>
>> <label for="degr" style="padding-right:1em;">
>> <input type="radio" name="formats" id="degr"
>> value="1" onClick="inputOutput()"; checked>
>> Degrees
>> </label>
>> <label for="dgmn2" style="padding-right:1em;">
>> <input type="checkbox" name="dgmn" id="dgmn2"
>> onClick="inputOutput()"> deg°min'
>> </label>
>
> The code doesn't work as expected but I'll work on it.
>
> emf
(Continued)
I couldn't understand very well your inputOutput() so simplified. I made
the deg°min' (within <span id="cgdgmn"></span>) disappear when radians
is clicked:
https://files.nyu.edu/emf202/public/js/spherical2.html
The code now is working OK, except that when it loads it gives this
error message:
TypeError: document.getElementById("cbdgmn") is null
pointing to the inputOutput else if line. Sorry, but that's way beyond
my comprehension. Why does it give this message only when loading and
not afterwards? Please explain.
And I would prefer it by clicking Clear it didn't affect the radio
buttons and the checkbox...
Now I have to start going through the message of PointedEars, who also
provides many interesting ideas.
emf
--
Epitaphios - Axion Esti - Canto General
Three important folk compositions of Mikis Theodorakis
https://files.nyu.edu/emf202/public/mt/index.html
[toc] | [prev] | [next] | [standalone]
| From | SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> |
|---|---|
| Date | 2012-08-20 14:00 +0200 |
| Message-ID | <503226e3$0$6218$ba4acef3@reader.news.orange.fr> |
| In reply to | #15453 |
Le 19/08/12 18:11, emf a écrit :
> On 2012-08-19 09:30 emf wrote:
>> On 2012-08-18 11:36 SAM wrote:
>>> Le 18/08/12 16:03, emf a écrit :
>>>> In my Spherical Triangle Calculator:
>>>> I considered making the deg°min' a checkbox instead:
>>>>
>>>> https://files.nyu.edu/emf202/public/js/spherical2.html
>>>
>>>
>>> if (using !== "r") {
>>> a = (a0 !== x)? rad(a0) : a0;
>>> ab = (ab0 !== x)? rad(ab0) : ab0;
>>
>> I should have thought of that.
>>
>>>> but there are problems with the code. To begin with, if you click
>>>> Radians, the degmin checkbox *is* disabled, but then when I click Clear
>>>> while the Degrees is selected the degmin remains disabled.
>>>
>>> <input type ="reset" onclick="dgmn.disabled=0" value="Clear">
>>
>> Thanks.
>>>
>>> Also, I'd
>>>> prefer if the radio buttons and the checkbox are outside the dataForm,
>>>> so their settings won't change with Clear, but then when clicking
>>>> Calculate, it should be able to tell the current status of the
>>>> buttons/checkbox.
>>>>
>>>> spherical2 is more logical, but is there a straightforward way to make
>>>> it work as it should?
>>>
>>> logical ... logical ... fast said !
>>> deg°min' would have to be displayed only if degrees are checked, no ?
>>
>> Interesting idea. I've been changing the code to make it disappear
>> instead of get disabled.
>>
>>>
>>>> P.S. The defective code in spherical2 is:
>>>
>>> I allways get "invalid entry" ... !!!
>>> What numbers could I enter ?
>>
>> Try for A, AB, B: 80, 100, 120 degrees or 1, 2, 3 radians. Or, more
>> interesting, A, B, BC 80, 120, 76.33.
>>
>> Or even:
>>
>> A: Paris 48.75N 2.33E
>> B: North Pole 90N
>> C: New York 40.75N -74W
>>
>> AB = 90 - 48.75 = 31.25
>> B = 74 + 2.33 = 76.33
>> BC = 90 - 40.75 = 49.25
>> CA = NY to Paris
>> (and, or course, distance = CA * 40000 / 360 km)
>>
>>> var using = "#°##.#'";
>>>
>>> function inputOutput() {
>>> var format = document.dataForm.formats.value,
>>> degMin = document.dataForm.dgmn.checked;
>>> document.dataForm.dgmn.disabled = (format === 0);
>>> using = format === 0? "r" : degMin? "#°##.#'" : ".###°";
>>> }
>>> ...
>>> <label for="rads" style="padding-right:1em;">
>>> <input type="radio" name="formats" id="rads"
>>> value="0" onClick="inputOutput()";> Radians
>>> </label>
>>> <label for="degr" style="padding-right:1em;">
>>> <input type="radio" name="formats" id="degr"
>>> value="1" onClick="inputOutput()"; checked>
>>> Degrees
>>> </label>
>>> <label for="dgmn2" style="padding-right:1em;">
>>> <input type="checkbox" name="dgmn" id="dgmn2"
>>> onClick="inputOutput()"> deg°min'
>>> </label>
>>
>> The code doesn't work as expected but I'll work on it.
>>
>> emf
>
> (Continued)
>
> I couldn't understand very well your inputOutput() so simplified. I made
> the deg°min' (within <span id="cgdgmn"></span>) disappear when radians
> is clicked:
>
> https://files.nyu.edu/emf202/public/js/spherical2.html
>
> The code now is working OK, except that when it loads it gives this
> error message:
>
> TypeError: document.getElementById("cbdgmn") is null
I can't see that ..
function inputOutput() {
var format = document.dataForm.formats,
n = format.length,
degMin = document.dataForm.dgmn.checked;
while(n--) if(format[n].checked) format=format[n].value;
document.dataForm.dgmn.parentNode.style.visibility = (format==0)?
'' : 'hidden';
using = format == 0? "r" : degMin? "#°##.#'" : ".###°";
}
> And I would prefer it by clicking Clear it didn't affect the radio
> buttons and the checkbox...
Il "Clear" is a reset button, clicking it must "reset" the whole code of
the form ;-)
--
Stéphane Moriaux avec/with iMac-intel
[toc] | [prev] | [next] | [standalone]
| From | emf <emfril@gmail.com> |
|---|---|
| Date | 2012-08-20 09:05 -0400 |
| Message-ID | <k0tcfo$q8t$1@speranza.aioe.org> |
| In reply to | #15461 |
On 2012-08-20 08:00 SAM wrote:
> Le 19/08/12 18:11, emf a écrit :
>> On 2012-08-19 09:30 emf wrote:
>>> On 2012-08-18 11:36 SAM wrote:
>>>> Le 18/08/12 16:03, emf a écrit :
>>>>> In my Spherical Triangle Calculator:
>>>>> I considered making the deg°min' a checkbox instead:
>>>>>
>>>>> https://files.nyu.edu/emf202/public/js/spherical2.html
>>>>
>>>>
>>>> if (using !== "r") {
>>>> a = (a0 !== x)? rad(a0) : a0;
>>>> ab = (ab0 !== x)? rad(ab0) : ab0;
>>>
>>> I should have thought of that.
>>>
>>>>> but there are problems with the code. To begin with, if you click
>>>>> Radians, the degmin checkbox *is* disabled, but then when I click
>>>>> Clear
>>>>> while the Degrees is selected the degmin remains disabled.
>>>>
>>>> <input type ="reset" onclick="dgmn.disabled=0" value="Clear">
>>>
>>> Thanks.
>>>>
>>>> Also, I'd
>>>>> prefer if the radio buttons and the checkbox are outside the dataForm,
>>>>> so their settings won't change with Clear, but then when clicking
>>>>> Calculate, it should be able to tell the current status of the
>>>>> buttons/checkbox.
>>>>>
>>>>> spherical2 is more logical, but is there a straightforward way to make
>>>>> it work as it should?
>>>>
>>>> logical ... logical ... fast said !
>>>> deg°min' would have to be displayed only if degrees are checked, no ?
>>>
>>> Interesting idea. I've been changing the code to make it disappear
>>> instead of get disabled.
>>>
>>>>
>>>>> P.S. The defective code in spherical2 is:
>>>>
>>>> I allways get "invalid entry" ... !!!
>>>> What numbers could I enter ?
>>>
>>> Try for A, AB, B: 80, 100, 120 degrees or 1, 2, 3 radians. Or, more
>>> interesting, A, B, BC 80, 120, 76.33.
>>>
>>> Or even:
>>>
>>> A: Paris 48.75N 2.33E
>>> B: North Pole 90N
>>> C: New York 40.75N -74W
>>>
>>> AB = 90 - 48.75 = 31.25
>>> B = 74 + 2.33 = 76.33
>>> BC = 90 - 40.75 = 49.25
>>> CA = NY to Paris
>>> (and, or course, distance = CA * 40000 / 360 km)
>>>
>>>> var using = "#°##.#'";
>>>>
>>>> function inputOutput() {
>>>> var format = document.dataForm.formats.value,
>>>> degMin = document.dataForm.dgmn.checked;
>>>> document.dataForm.dgmn.disabled = (format === 0);
>>>> using = format === 0? "r" : degMin? "#°##.#'" : ".###°";
>>>> }
>>>> ...
>>>> <label for="rads" style="padding-right:1em;">
>>>> <input type="radio" name="formats" id="rads"
>>>> value="0" onClick="inputOutput()";> Radians
>>>> </label>
>>>> <label for="degr" style="padding-right:1em;">
>>>> <input type="radio" name="formats" id="degr"
>>>> value="1" onClick="inputOutput()"; checked>
>>>> Degrees
>>>> </label>
>>>> <label for="dgmn2" style="padding-right:1em;">
>>>> <input type="checkbox" name="dgmn" id="dgmn2"
>>>> onClick="inputOutput()"> deg°min'
>>>> </label>
>>>
>>> The code doesn't work as expected but I'll work on it.
>>>
>>> emf
>>
>> (Continued)
>>
>> I couldn't understand very well your inputOutput() so simplified. I made
>> the deg°min' (within <span id="cgdgmn"></span>) disappear when radians
>> is clicked:
>>
>> https://files.nyu.edu/emf202/public/js/spherical2.html
>>
>> The code now is working OK, except that when it loads it gives this
>> error message:
>>
>> TypeError: document.getElementById("cbdgmn") is null
>
> I can't see that ..
>
> function inputOutput() {
> var format = document.dataForm.formats,
> n = format.length,
> degMin = document.dataForm.dgmn.checked;
> while(n--) if(format[n].checked) format=format[n].value;
> document.dataForm.dgmn.parentNode.style.visibility = (format==0)?
> '' : 'hidden';
> using = format == 0? "r" : degMin? "#°##.#'" : ".###°";
> }
>
>> And I would prefer it by clicking Clear it didn't affect the radio
>> buttons and the checkbox...
>
> Il "Clear" is a reset button, clicking it must "reset" the whole code of
> the form ;-)
I believe that at last I can stop worrying with the code. I had started
writing the program in QBasic some 10 years ago as an offshoot of a
program that draws the globe, but had then encountered insurmountable
then problems with the ambiguous cases (I an neither a professional
mathematician nor a programmer) and had left it aside.
I explain the reset in another message.
After trial and error, I accepted your approach that inputOutput does
not accept any parameters, but I get the status of the radioboxes and
the checkbox in another way.
It seems that since the inputOutput function loads before the rest of
the webpage, I had to write
if ((rads !== null) && (degr !== null) && (dgmn !== null)
&& (spanCheckbox !== null)) {
...
}
else {
using = ".###°";
}
so that when first loading the webpage it would just initialize the
using to a value corresponding the initial condition of the radio
buttons and the checkbox. The error messages did not interfere with the
program, but I do not like to get error messages. Then I though of
substituting all these conditions with
if (using !== undefined) {
...
}
elseelse { using = ".###°"; }
which is simpler and up to the point; in the first run, there I just
have to define using. The other elements are being taken care of by the
html code.
Bye,
emf
--
It ain't THAT, babe! - A radical reinterpretation
https://files.nyu.edu/emf202/public/bd/itaintmebabe.html
[toc] | [prev] | [next] | [standalone]
| From | SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> |
|---|---|
| Date | 2012-08-20 16:11 +0200 |
| Message-ID | <5032459b$0$6216$ba4acef3@reader.news.orange.fr> |
| In reply to | #15463 |
Le 20/08/12 15:05, emf a écrit :
>
> if (using !== undefined) {
if(typeof using != 'undefined') {
Your code :
if (rads.checked === true) {
can simply be :
if (rads.checked) {
The spanCheckbox will be hidden if the radians is checked :
spanCheckbox.style.visibility = rads.checked? "hidden" : "";
function inputOutput() {
var rads = document.getElementById("rads"),
degr = document.getElementById("degr"),
dgmn = document.getElementById("dgmn"),
spanCheckbox = document.getElementById("degmin");
spanCheckbox.style.visibility = rads.checked? "hidden" : "";
using = (typeof using == 'undefined')? ".###°" :
rads.checked? 'r' :
!dgmn.checked? ".###°" : "#°##.#'";
}
function clearValues() { // it resets only the text fields
var f = document.dataForm.elements,
n = f.length;
while(n--) if(f[n].type == 'text') f[n].value = '';
}
--
Stéphane Moriaux avec/with iMac-intel
[toc] | [prev] | [next] | [standalone]
| From | emf <emfril@gmail.com> |
|---|---|
| Date | 2012-08-21 05:25 -0400 |
| Message-ID | <k0vk0p$pj0$1@speranza.aioe.org> |
| In reply to | #15464 |
On 2012-08-20 10:11 SAM wrote:
> Le 20/08/12 15:05, emf a écrit :
>>
>> if (using !== undefined) {
>
> if(typeof using != 'undefined') {
Now the file I am editing is
https://files.nyu.edu/emf202/public/js/spherical.html
rather than spherical2.html
I inserted javascript code calling the imputOutput() function in the
body immediately after the checkbox, so my problem with the null
elements was solved.
>
> Your code :
> if (rads.checked === true) {
> can simply be :
> if (rads.checked) {
>
>
> The spanCheckbox will be hidden if the radians is checked :
> spanCheckbox.style.visibility = rads.checked? "hidden" : "";
Yes and yes. You take from me the pleasure of improving the code myself
at some future point. By writing (rads.checked === true) I somehow
wanted to make absolutely sure I wouldn't get some error message, though
I knew I shouldn't have a used the shorter version.
>
> function inputOutput() {
> var rads = document.getElementById("rads"),
> degr = document.getElementById("degr"),
> dgmn = document.getElementById("dgmn"),
> spanCheckbox = document.getElementById("degmin");
I'll start adopting this kind of syntax.
> spanCheckbox.style.visibility = rads.checked? "hidden" : "";
> using = (typeof using == 'undefined')? ".###°" :
> rads.checked? 'r' :
> !dgmn.checked? ".###°" : "#°##.#'";
> }
I was convinced by Thomas arguments and reverted to making the checkbox
disabled rather than having it disappear.
Now I do not need an if statement to see if using is undefined.
I do not feel comfortable of using the shorthand syntax above (using =
...) when it gets more complicated.
> function clearValues() { // it resets only the text fields
> var f = document.dataForm.elements,
> n = f.length;
> while(n--) if(f[n].type == 'text') f[n].value = '';
> }
Nice! I have to apply this to some other code I have written. Except
that, again, I feel more comfortable with a simpler for loop. I do not
find this while(n--) intuitive enough for me.
Thanks,
emf
--
Date Calculator with all-purpose JS code
https://files.nyu.edu/emf202/public/js/dateCalculator.html
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2012-08-21 14:36 +0200 |
| Message-ID | <3895441.YumZ7nWkzv@PointedEars.de> |
| In reply to | #15476 |
emf wrote:
> On 2012-08-20 10:11 SAM wrote:
>> function inputOutput() {
>> var rads = document.getElementById("rads"),
>> degr = document.getElementById("degr"),
>> dgmn = document.getElementById("dgmn"),
>> spanCheckbox = document.getElementById("degmin");
>
> I'll start adopting this kind of syntax.
Why?
PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.)
[toc] | [prev] | [next] | [standalone]
| From | SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> |
|---|---|
| Date | 2012-08-22 12:24 +0200 |
| Message-ID | <5034b347$0$6202$ba4acef3@reader.news.orange.fr> |
| In reply to | #15476 |
Le 21/08/12 11:25, emf a écrit :
> On 2012-08-20 10:11 SAM wrote:
>
>> function clearValues() { // it resets only the text fields
>> var f = document.dataForm.elements,
>> n = f.length;
>> while(n--) if(f[n].type == 'text') f[n].value = '';
>> }
>
> Nice! I have to apply this to some other code I have written. Except
> that, again, I feel more comfortable with a simpler for loop. I do not
> find this while(n--) intuitive enough for me.
to be closer to 'for' :
function clearValues() { // it resets only the text fields
var f = document.forms['dataForm'].elements,
n = f.length,
c = 0;
while(c<n) {
if(f[n].type == 'text') f[n].value = '';
c++;
}
f=n=c=null;
}
But the 'for' loop doesn't need more lines
(maybe is it less fast than 'while ?)
function clearValues() { // it resets only the text fields
var f = document.forms['dataForm'].elements,
for ( var i=0, n = f.length; i<n; i++)
if(f[n].type == 'text') f[n].value = '';
}
--
Stéphane Moriaux avec/with iMac-intel
[toc] | [prev] | [next] | [standalone]
| From | SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> |
|---|---|
| Date | 2012-08-20 12:13 +0200 |
| Message-ID | <50320de6$0$6213$ba4acef3@reader.news.orange.fr> |
| In reply to | #15451 |
Le 19/08/12 15:30, emf a écrit :
>
>> var using = "#°##.#'";
>>
>> function inputOutput() {
>> var format = document.dataForm.formats.value,
>> degMin = document.dataForm.dgmn.checked;
>> document.dataForm.dgmn.disabled = (format === 0);
>> using = format === 0? "r" : degMin? "#°##.#'" : ".###°";
>> }
>> ...
>> <label for="rads" style="padding-right:1em;">
>> <input type="radio" name="formats" id="rads"
>> value="0" onClick="inputOutput()";> Radians
>> </label>
>> <label for="degr" style="padding-right:1em;">
>> <input type="radio" name="formats" id="degr"
>> value="1" onClick="inputOutput()"; checked>
>> Degrees
>> </label>
>> <label for="dgmn2" style="padding-right:1em;">
>> <input type="checkbox" name="dgmn" id="dgmn2"
>> onClick="inputOutput()"> deg°min'
>> </label>
>
> The code doesn't work as expected but I'll work on it.
<script type="text/javascript">
var using = "#°##.#'";
function inputOutput() {
var format = document.dataForm.formats,
n = format.length,
degMin = document.dataForm.dgmn.checked;
while(n--) if(format[n].checked) format=format[n].value;
document.dataForm.dgmn.disabled = (format == 0);
using = format == 0? "r" : degMin? "#°##.#'" : ".###°";
}
</script>
--
Stéphane Moriaux avec/with iMac-intel
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2012-08-20 16:27 +0200 |
| Message-ID | <3964677.5NdWTflnOZ@PointedEars.de> |
| In reply to | #15451 |
emf wrote: > On 2012-08-18 11:36 SAM wrote: >> Le 18/08/12 16:03, emf a écrit : >>> but there are problems with the code. To begin with, if you click >>> Radians, the degmin checkbox *is* disabled, but then when I click Clear >>> while the Degrees is selected the degmin remains disabled. >> >> <input type ="reset" onclick="dgmn.disabled=0" value="Clear"> > > Thanks. The `disabled' property is of type *boolean*, _not_ number. You need to assign `false' (without quotes) instead. Anything else is implementation- dependent, therefore unreliable. <http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-6043025> PointedEars -- Prototype.js was written by people who don't know javascript for people who don't know javascript. People who don't know javascript are not the best source of advice on designing systems that use javascript. -- Richard Cornford, cljs, <f806at$ail$1$8300dec7@news.demon.co.uk>
[toc] | [prev] | [next] | [standalone]
| From | SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> |
|---|---|
| Date | 2012-08-20 21:58 +0200 |
| Message-ID | <503296ed$0$6201$ba4acef3@reader.news.orange.fr> |
| In reply to | #15466 |
Le 20/08/12 16:27, Thomas 'PointedEars' Lahn a écrit :
>> On 2012-08-18 11:36 SAM wrote:
>>>
>>> <input type ="reset" onclick="dgmn.disabled=0" value="Clear">
>
> The `disabled' property is of type *boolean*, _not_ number. You need to
> assign `false' (without quotes) instead. Anything else is implementation-
> dependent, therefore unreliable.
>
> <http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-6043025>
I do not understand what you say (is my English too poor ?)
or what they say at w3c ...
as I read at this url you mentioned :
attribute boolean checked;
attribute boolean disabled;
and I see nothing about 0 and 1 taken as equivalents for false and true
(i.e : in definitions I could see with gugl)
--
Stéphane Moriaux avec/with iMac-intel
[toc] | [prev] | [next] | [standalone]
| From | emf <emfril@gmail.com> |
|---|---|
| Date | 2012-08-21 10:58 -0400 |
| Message-ID | <k107gh$8j9$1@speranza.aioe.org> |
| In reply to | #15466 |
On 2012-08-20 10:27 Thomas 'PointedEars' Lahn wrote: > emf wrote: > >> On 2012-08-18 11:36 SAM wrote: >>> Le 18/08/12 16:03, emf a écrit : >>>> but there are problems with the code. To begin with, if you click >>>> Radians, the degmin checkbox *is* disabled, but then when I click Clear >>>> while the Degrees is selected the degmin remains disabled. >>> >>> <input type ="reset" onclick="dgmn.disabled=0" value="Clear"> >> >> Thanks. > > The `disabled' property is of type *boolean*, _not_ number. You need to > assign `false' (without quotes) instead. Anything else is implementation- > dependent, therefore unreliable. > > <http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-6043025> > > > PointedEars While debugging, at some point I inserted an alert like: alert((a === x) + (b === x) + (c === x)); avoiding inserting spaces as not necessary for my purposes, and expecting to get truetruetrue. Instead I got 3. The + sign had changed the booleans to the corresponding numbers. emf -- It ain't THAT, babe! - A radical reinterpretation https://files.nyu.edu/emf202/public/bd/itaintmebabe.html
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2012-08-22 10:41 +0200 |
| Message-ID | <1999762.TLoaxox4F2@PointedEars.de> |
| In reply to | #15481 |
emf wrote: > On 2012-08-20 10:27 Thomas 'PointedEars' Lahn wrote: >> emf wrote: >>> On 2012-08-18 11:36 SAM wrote: >>>> Le 18/08/12 16:03, emf a écrit : >>>>> but there are problems with the code. To begin with, if you click >>>>> Radians, the degmin checkbox *is* disabled, but then when I click >>>>> Clear while the Degrees is selected the degmin remains disabled. >>>> >>>> <input type ="reset" onclick="dgmn.disabled=0" value="Clear"> >>> >>> Thanks. >> >> The `disabled' property is of type *boolean*, _not_ number. You need to >> assign `false' (without quotes) instead. Anything else is >> implementation- dependent, therefore unreliable. >> >> <http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-6043025> > > While debugging, at some point I inserted an alert like: > > alert((a === x) + (b === x) + (c === x)); > > avoiding inserting spaces as not necessary for my purposes, and > expecting to get truetruetrue. Instead I got 3. The + sign had changed > the booleans to the corresponding numbers. Unsurprising, since as all operands were non-strings. Your point being? Please trim your quotes to the relevant minimum; do not quote signatures. And get a a real name. PointedEars -- > If you get a bunch of authors […] that state the same "best practices" > in any programming language, then you can bet who is wrong or right... Not with javascript. Nonsense propagates like wildfire in this field. -- Richard Cornford, comp.lang.javascript, 2011-11-14
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2012-08-22 10:14 +0000 |
| Message-ID | <XnsA0B77C74131F6eejj99@194.109.133.133> |
| In reply to | #15481 |
emf wrote on 21 aug 2012 in comp.lang.javascript:
> While debugging, at some point I inserted an alert like:
>
> alert((a === x) + (b === x) + (c === x));
alert('' + (a === x) + (b === x) + (c === x));
>
> avoiding inserting spaces as not necessary for my purposes, and
> expecting to get truetruetrue. Instead I got 3. The + sign had changed
> the booleans to the corresponding numbers.
>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> |
|---|---|
| Date | 2012-08-22 14:31 +0200 |
| Message-ID | <5034d131$0$6183$ba4acef3@reader.news.orange.fr> |
| In reply to | #15481 |
Le 21/08/12 16:58, emf a écrit :
> While debugging, at some point I inserted an alert like:
>
> alert((a === x) + (b === x) + (c === x));
probably better with :
While debugging, at some point I inserted an alert like:
alert(
(a === x) +
(b === x) +
(c === x)
);
The console of errors can then give you which line is in error
(maybe a, b, c or x is unknown ? how to see which one ?)
--
Stéphane Moriaux avec/with iMac-intel
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2012-08-18 19:18 +0200 |
| Message-ID | <2760364.jIkiNM8doB@PointedEars.de> |
| In reply to | #15413 |
emf wrote: ^^^ Who? > In my Spherical Triangle Calculator: > > https://files.nyu.edu/emf202/public/js/spherical.html > > one can select 1 of 3 radio buttons. Degrees and Radians affect the > input and the output, while degmin affects the output only. > > I considered making the deg°min' a checkbox instead: > > https://files.nyu.edu/emf202/public/js/spherical2.html > > but there are problems with the code. To begin with, if you click > Radians, the degmin checkbox *is* disabled, but then when I click Clear > while the Degrees is selected the degmin remains disabled. You could call the "Degrees" radiobutton's onclick() property when the "Clear" button is activated, or you could simply call the function called the former's click event listener. The latter is probably more compatible, but in more than a decade of browser scripting I have not yet encountered a DOM where calling the onclick() property would fail under these circumstances.¹ You may even call the radiobutton's click() method instead if it has any, or despatch a `click' event to it, but tests as to that are pending as well. ¹ Indeed, the HTML5 Working Draft suggests that calling the onclick() property is well-supported even with a HTML 4.01 DOM API: <http://www.w3.org/TR/html5/webappapis.html#event-handlers-on-elements- document-objects-and-window-objects> > Also, I'd prefer if the radio buttons and the checkbox are outside the > dataForm, so their settings won't change with Clear, but then when > clicking Calculate, it should be able to tell the current status of the > buttons/checkbox. A reset button in a form is usually a bad idea to begin with as it carries with it the risk of accidentally undoing all user inputs², but in your case an exception can be made. Therefore, it is a bad idea to place form controls outside the form because then it could not be made to work without client-side DOM scripting, which you should consider implementing. ² <http://www.useit.com/alertbox/20000416.html> > […] > <label for="rads" style="padding-right:1em;"> > <input type="radio" name="formats" > onClick="inputOutput(0)";> Radians > </label> > <label for="degr" style="padding-right:1em;"> > <input type="radio" name="formats" > onClick="inputOutput(1)"; checked> Degrees > </label> > <label for="dgmn2" style="padding-right:1em;"> > <input type="checkbox" name="dgmn" > onClick="inputOutput(2)"> deg°min' > </label> > ... Your LABEL elements do not work (clicking them does not focus the control) in Chromium 21.0.1180.75 Built on Debian wheezy/sid, running on Debian 6.0.5 (150248), and most certainly other browsers, because you have not specified the `rads' aso. IDs on the corresponding form controls. With this approach, you need to omit the `for' attribute on the LABEL elements. However, indication of control activation might be rendered better (such as a dotted line around the text of the label of the activated control, excluding leading and trailing whitespace, as users would expect from other GUIs) if you used the `for' attribute and specified a corresponding `id' attribute on the corresponding control, but would not have the control as a child element of the LABEL element. <http://www.w3.org/TR/html401/interact/forms.html#edef-LABEL> PointedEars -- When all you know is jQuery, every problem looks $(olvable).
[toc] | [prev] | [next] | [standalone]
| From | emf <emfril@gmail.com> |
|---|---|
| Date | 2012-08-20 08:29 -0400 |
| Message-ID | <k0tacn$l8s$1@speranza.aioe.org> |
| In reply to | #15428 |
On 2012-08-18 13:18 Thomas 'PointedEars' Lahn wrote: > emf wrote: > ^^^ > Who? Check the sig in this message. >> In my Spherical Triangle Calculator: >> >> https://files.nyu.edu/emf202/public/js/spherical.html >> >> one can select 1 of 3 radio buttons. Degrees and Radians affect the >> input and the output, while degmin affects the output only. >> >> I considered making the deg°min' a checkbox instead: >> >> https://files.nyu.edu/emf202/public/js/spherical2.html >> >> but there are problems with the code. To begin with, if you click >> Radians, the degmin checkbox *is* disabled, but then when I click Clear >> while the Degrees is selected the degmin remains disabled. > > You could call the "Degrees" radiobutton's onclick() property when the > "Clear" button is activated, or you could simply call the function called > the former's click event listener. The latter is probably more compatible, > but in more than a decade of browser scripting I have not yet encountered a > DOM where calling the onclick() property would fail under these > circumstances.¹ You may even call the radiobutton's click() method instead > if it has any, or despatch a `click' event to it, but tests as to that are > pending as well. > > ¹ Indeed, the HTML5 Working Draft suggests that calling the onclick() > property is well-supported even with a HTML 4.01 DOM API: > <http://www.w3.org/TR/html5/webappapis.html#event-handlers-on-elements- > document-objects-and-window-objects> > >> Also, I'd prefer if the radio buttons and the checkbox are outside the >> dataForm, so their settings won't change with Clear, but then when >> clicking Calculate, it should be able to tell the current status of the >> buttons/checkbox. > > A reset button in a form is usually a bad idea to begin with as it carries > with it the risk of accidentally undoing all user inputs², but in your case > an exception can be made. Therefore, it is a bad idea to place form > controls outside the form because then it could not be made to work without > client-side DOM scripting, which you should consider implementing. > ² <http://www.useit.com/alertbox/20000416.html> I believe I've solved the problems, though I am not sure that there are other more elegant solutions: https://files.nyu.edu/emf202/public/js/spherical2.html Instead of disabling the checkbox, I have it disappear. I had to reset the form onload, because when reloading the webpage, something that I had to do often when working on the code, the checks would not change from what they were before, while the using would change. And instead of <input type="reset"...> I now use <input type="button" ... onclick="clearValues()> pointing to a function that resets only the text fields one by one, but not the buttons and the checkbox. So now the radio buttons and the checkbox now are all inside the form. It is true that the reset is a kind of a blunt instrument; thanks for the link. >> […] >> <label for="rads" style="padding-right:1em;"> >> <input type="radio" name="formats" >> onClick="inputOutput(0)";> Radians >> </label> >> <label for="degr" style="padding-right:1em;"> >> <input type="radio" name="formats" >> onClick="inputOutput(1)"; checked> Degrees >> </label> >> <label for="dgmn2" style="padding-right:1em;"> >> <input type="checkbox" name="dgmn" >> onClick="inputOutput(2)"> deg°min' >> </label> >> ... > > Your LABEL elements do not work (clicking them does not focus the control) > in Chromium 21.0.1180.75 Built on Debian wheezy/sid, running on Debian 6.0.5 > (150248), and most certainly other browsers, because you have not specified > the `rads' aso. IDs on the corresponding form controls. With this approach, > you need to omit the `for' attribute on the LABEL elements. I tend to be "minimalist" removing from the code what does not seem clearly necessary, so at one point, since id is not an essential attribute of label, I decided to remove them... Later I observed that the labels were not working as they should, but because of other problems I had left the issue aside. Now they are back. > However, indication of control activation might be rendered better (such as > a dotted line around the text of the label of the activated control, > excluding leading and trailing whitespace, as users would expect from other > GUIs) if you used the `for' attribute and specified a corresponding `id' > attribute on the corresponding control, but would not have the control as a > child element of the LABEL element. > > <http://www.w3.org/TR/html401/interact/forms.html#edef-LABEL> > > > PointedEars Thanks for your input, and I would appreciate any further comments. emf PS. How do you insert number superscripts when typing a message? I am using DejaVu fonts that has in superscript form all the numbers, but I do not see an easier way to insert them than by opening the Character Map. -- It ain't THAT, babe! - A radical reinterpretation https://files.nyu.edu/emf202/public/bd/itaintmebabe.html
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2012-08-20 16:25 +0200 |
| Message-ID | <2066056.VtcmPVeGr1@PointedEars.de> |
| In reply to | #15462 |
emf wrote: > On 2012-08-18 13:18 Thomas 'PointedEars' Lahn wrote: >> emf wrote: >> ^^^ >> Who? > > Check the sig in this message. Your sig does not contain your real name. Regardless, your real name belongs in the From header field value on Usenet (except in groups with sensitive topics). Any nicknames may be put in quotes in-between. >> ² <http://www.useit.com/alertbox/20000416.html> > > I believe I've solved the problems, though I am not sure that there are > other more elegant solutions: > > https://files.nyu.edu/emf202/public/js/spherical2.html > > Instead of disabling the checkbox, I have it disappear. Bad idea. > I had to reset the form onload, because when reloading the webpage, > something that I had to do often when working on the code, the checks > would not change from what they were before, while the using would change. That is what users expect, as they have asked the Mozilla people to implement it so. You should not work against their expectations. > And instead of > <input type="reset"...> I now use > > <input type="button" ... onclick="clearValues()> Another bad idea. You can keep the reset button (if you must) *and* use an event-handler attribute on it. > PS. How do you insert number superscripts when typing a message? I am > using DejaVu fonts that has in superscript form all the numbers, but I > do not see an easier way to insert them than by opening the Character Map. Using XKB and typing `^1' etc. (without quotes). PointedEars -- Anyone who slaps a 'this page is best viewed with Browser X' label on a Web page appears to be yearning for the bad old days, before the Web, when you had very little chance of reading a document written on another computer, another word processor, or another network. -- Tim Berners-Lee
[toc] | [prev] | [next] | [standalone]
Page 1 of 2 [1] 2 Next page →
Back to top | Article view | comp.lang.javascript
csiph-web