check boxes again | |
Trying this question again in a different way and expanding it to
another newsgroup. Looking for how I would do this.
For an html form;
Say I have three check boxes A, B, and C . When I click on a checkbox a
dropdown window will open next to it and the selections will be 1, 2,
and 3. I want to use the same script and dropdown for each of the 3
check boxes and be able to return values independent of each other.
Meaning if I check box A and then select 2 it will return A and 2 for
checkbox A. Then moving on to B I can check B and select 1, returning B
and 1. I want to be able to do this for one two, or all of the
checkboxes, but I only want the dropdowns displayed if the box is
checked. Does that make any sense? Pointers, links or example scripts
appreciated.
Thanks again so much for your input.
--
Patrick A. Smith Assistant System Administrator
Ocean Circulation Group – USF - College of Marine Science http://ocgweb.marine.usf.edu
The trouble with doing something right the first time is that nobody
appreciates how difficult it was. - La Rochefoucauld | | | | re: check boxes again
Patrick wrote: Quote:
Trying this question again in a different way and expanding it to
another newsgroup. Looking for how I would do this.
Usually people want to see some effort on your part. Quote:
>
For an html form;
>
Say I have three check boxes A, B, and C . When I click on a checkbox
That would be onclick;
<input type="checkbox" onclick="doSomeJavascriptFunction(this)">
a Quote:
dropdown window will open next to it
Could be display: none
function doSomeJavascriptFunction(obj){
if(obj.checked){
reference_to_rolldown.style.display = 'block';
}else{
reference_to_rolldown.style.display = 'none';
}
}
where reference to rolldown might be:
document.getElementById('id_of_hidden_rolldown')
and the selections will be 1, 2, Quote:
and 3. I want to use the same script and dropdown for each of the 3
check boxes and be able to return values independent of each other.
Meaning if I check box A and then select 2 it will return A and 2 for
checkbox A. Then moving on to B I can check B and select 1, returning B
and 1. I want to be able to do this for one two, or all of the
checkboxes, but I only want the dropdowns displayed if the box is
checked. Does that make any sense?
No.
Jeff
Pointers, links or example scripts Quote:
appreciated.
>
Thanks again so much for your input.
>
| | | | re: check boxes again
Jeff wrote: Quote:
Patrick wrote: Quote:
>Trying this question again in a different way and expanding it to
>another newsgroup. Looking for how I would do this.
>
Usually people want to see some effort on your part. Quote:
>>
>For an html form;
>>
>Say I have three check boxes A, B, and C . When I click on a checkbox
>
That would be onclick;
>
<input type="checkbox" onclick="doSomeJavascriptFunction(this)">
>
a Quote:
>dropdown window will open next to it
>
Could be display: none
>
function doSomeJavascriptFunction(obj){
>
if(obj.checked){
reference_to_rolldown.style.display = 'block';
}else{
reference_to_rolldown.style.display = 'none';
}
>
}
>
where reference to rolldown might be:
>
document.getElementById('id_of_hidden_rolldown')
>
and the selections will be 1, 2, Quote:
>and 3. I want to use the same script and dropdown for each of the 3
>check boxes and be able to return values independent of each other.
>Meaning if I check box A and then select 2 it will return A and 2 for
>checkbox A. Then moving on to B I can check B and select 1, returning
>B and 1. I want to be able to do this for one two, or all of the
>checkboxes, but I only want the dropdowns displayed if the box is
>checked. Does that make any sense?
>
No.
>
Jeff
>
Pointers, links or example scripts Quote:
>appreciated.
>>
>Thanks again so much for your input.
>>
Jeff,
I have effort to show. It is at the link below. I have some of what you
have written. Perhaps you will be able to better understand the part of
my question you didn't understand. Remember, the link is to a rough page
and is not all tidied up, etc. and submit has been disabled. http://ocgweb.marine.usf.edu/Orbgps/chbox_exmp.php
--
Patrick
Go Bulls! | | | | re: check boxes again
On Nov 18, 8:40*pm, Patrick wrote: Quote: Quote: Quote:
Trying this question again in a different way and expanding it to
another newsgroup. Looking for how I would do this. *
Have a look at the CGI::Ajax Perl module from CPAN.
It comes with examples, maybe there is something
you could use, http://search.cpan[.]org/src/BPEDERSE/CGI-Ajax-0.707/scripts/
(remove the square brackets from the URL). | | | | re: check boxes again
Patrick wrote: Quote:
Trying this question again in a different way and expanding it to
another newsgroup. Looking for how I would do this.
>
For an html form;
>
Say I have three check boxes A, B, and C . When I click on a checkbox a
dropdown window will open next to it and the selections will be 1, 2,
and 3. I want to use the same script and dropdown for each of the 3
check boxes and be able to return values independent of each other.
Meaning if I check box A and then select 2 it will return A and 2 for
checkbox A. Then moving on to B I can check B and select 1, returning B
and 1. I want to be able to do this for one two, or all of the
checkboxes, but I only want the dropdowns displayed if the box is
checked. Does that make any sense? Pointers, links or example scripts
appreciated.
>
Thanks again so much for your input.
>
If you're feeling adventurous, check out jQuery: It can do what you want, and then some. Warnings: there is a bit of a
learning curve, and (much like Flash) because there's so much that you
can do with it, you have to make an effort not to do things just because
you "can."
--
David Hennessy | | | | re: check boxes again
On Nov 18, 6:17*pm, David Hennessy <da...@FOADSPAMMERmaidix.com>
wrote: Quote:
Patrick wrote: Quote:
Trying this question again in a different way and expanding it to
another newsgroup. Looking for how I would do this.
> > Quote:
Say I have three check boxes A, B, and C . When I click on a checkbox a
dropdown window will open next to it and the selections will be 1, 2,
and 3. I want to use the same script and dropdown for each of the 3
check boxes and be able to return values independent of each other.
Meaning if I check box A and then select 2 it will return A and 2 for
checkbox A. Then moving on to B I can check B and select 1, returning B
and 1. I want to be able to do this for one two, or all of the
checkboxes, but I only want the dropdowns displayed if the box is
checked. Does that make any sense? Pointers, links or example scripts
appreciated.
> Quote:
Thanks again so much for your input.
>
If you're feeling adventurous, check out jQuery:
You mean if you feel like tangling up your documents with a neophyte's
first attempt at browser scripting, enjoy keeping constant vigilance
on browser sniffing patches, then by all means check out jQuery (or
Prototype or YUI.) [snip] Quote:
>
It can do what you want, and then some. Warnings: there is a bit of a
It can't do anything right. Where have you been? Quote:
learning curve, and (much like Flash) because there's so much that you
Oh and it takes time to learn how to do everything wrong. Jeez, what
a waste. | | | | re: check boxes again
David Mark wrote: Quote:
On Nov 18, 6:17 pm, David Hennessy <da...@FOADSPAMMERmaidix.com>
wrote: Quote:
>Patrick wrote: Quote:
>>Trying this question again in a different way and expanding it to
>>another newsgroup. Looking for how I would do this.
>>For an html form;
>>Say I have three check boxes A, B, and C . When I click on a checkbox a
>>dropdown window will open next to it and the selections will be 1, 2,
>>and 3. I want to use the same script and dropdown for each of the 3
>>check boxes and be able to return values independent of each other.
>>Meaning if I check box A and then select 2 it will return A and 2 for
>>checkbox A. Then moving on to B I can check B and select 1, returning B
>>and 1. I want to be able to do this for one two, or all of the
>>checkboxes, but I only want the dropdowns displayed if the box is
>>checked. Does that make any sense? Pointers, links or example scripts
>>appreciated.
>>Thanks again so much for your input.
>If you're feeling adventurous, check out jQuery:
>
You mean if you feel like tangling up your documents with a neophyte's
first attempt at browser scripting, enjoy keeping constant vigilance
on browser sniffing patches, then by all means check out jQuery (or
Prototype or YUI.)
>
[snip] Quote:
>It can do what you want, and then some. Warnings: there is a bit of a
>
It can't do anything right. Where have you been?
I actually haven't encountered arguments against jQuery so far. I did
recently move out into the sticks. I'll blame it on that. :-P Quote: Quote:
>learning curve, and (much like Flash) because there's so much that you
>
Oh and it takes time to learn how to do everything wrong. Jeez, what
a waste.
Is jQuery analogous to Flash, in that it can be used right, but often
isn't? Or do its flaws run deeper than that?
--
David Hennessy | | | | re: check boxes again
David Hennessy meinte: Quote:
Is jQuery analogous to Flash, in that it can be used right, but often
isn't? Or do its flaws run deeper than that?
Oh puhleeze! This topic comes up here twice a week. Everything has been
said before. Use your favourite search engine. And to make it really
short: The flaws run much deeper.
Gregor | | | | re: check boxes again
On Nov 19, 7:40*am, David Hennessy <da...@FOADSPAMMERmaidix.com>
wrote: Quote:
David Mark wrote: Quote:
On Nov 18, 6:17 pm, David Hennessy <da...@FOADSPAMMERmaidix.com>
wrote: Quote:
Patrick wrote:
>Trying this question again in a different way and expanding it to
>another newsgroup. Looking for how I would do this.
>For an html form;
>Say I have three check boxes A, B, and C . When I click on a checkboxa
>dropdown window will open next to it and the selections will be 1, 2,
>and 3. I want to use the same script and dropdown for each of the 3
>check boxes and be able to return values independent of each other.
>Meaning if I check box A and then select 2 it will return A and 2 for
>checkbox A. Then moving on to B I can check B and select 1, returningB
>and 1. I want to be able to do this for one two, or all of the
>checkboxes, but I only want the dropdowns displayed if the box is
>checked. Does that make any sense? Pointers, links or example scripts
>appreciated.
>Thanks again so much for your input.
If you're feeling adventurous, check out jQuery:
> Quote:
You mean if you feel like tangling up your documents with a neophyte's
first attempt at browser scripting, enjoy keeping constant vigilance
on browser sniffing patches, then by all means check out jQuery (or
Prototype or YUI.)
> Quote:
[snip] Quote:
It can do what you want, and then some. Warnings: there is a bit of a
> Quote:
It can't do anything right. *Where have you been?
>
I actually haven't encountered arguments against jQuery so far. I did
recently move out into the sticks. I'll blame it on that. :-P
Okay. You have come to the right place. Quote:
> Quote: Quote:
learning curve, and (much like Flash) because there's so much that you
> Quote:
Oh and it takes time to learn how to do everything wrong. *Jeez, what
a waste.
>
Is jQuery analogous to Flash, in that it can be used right, but often isn't?
No. Quote:
Or do its flaws run deeper than that?
Much deeper. And whereas Flash has its reasonable uses (e.g.
photograph rendering) and the possibility of using feature testing and
progressive enhancement (but not with Adobe's deployment kit or any of
the open source libraries), jQuery is always useless (on the Web
certainly) and a surefire train wreck in all but a handful of desktop
browsers in their default configurations (try degrading gracefully
from an exception.) Furthermore, it encourages coding patterns that
are outrageously inefficient, its author is a known bumpkin, support
group is useless, etc., etc. In short, don't hitch your star to
*that* wagon.
As I said, where have you been? Don't they get network news in "the
sticks?" | | | | re: check boxes again
David Mark wrote: Quote:
On Nov 19, 7:40 am, David Hennessy <da...@FOADSPAMMERmaidix.com>
wrote: Quote:
>David Mark wrote: Quote:
>>On Nov 18, 6:17 pm, David Hennessy <da...@FOADSPAMMERmaidix.com>
>>wrote:
>>>Patrick wrote:
>>>>Trying this question again in a different way and expanding it to
>>>>another newsgroup. Looking for how I would do this.
>>>>For an html form;
>>>>Say I have three check boxes A, B, and C . When I click on a checkbox a
>>>>dropdown window will open next to it and the selections will be 1, 2,
>>>>and 3. I want to use the same script and dropdown for each of the 3
>>>>check boxes and be able to return values independent of each other.
>>>>Meaning if I check box A and then select 2 it will return A and 2 for
>>>>checkbox A. Then moving on to B I can check B and select 1, returning B
>>>>and 1. I want to be able to do this for one two, or all of the
>>>>checkboxes, but I only want the dropdowns displayed if the box is
>>>>checked. Does that make any sense? Pointers, links or example scripts
>>>>appreciated.
>>>>Thanks again so much for your input.
>>>If you're feeling adventurous, check out jQuery:
>>You mean if you feel like tangling up your documents with a neophyte's
>>first attempt at browser scripting, enjoy keeping constant vigilance
>>on browser sniffing patches, then by all means check out jQuery (or
>>Prototype or YUI.)
>>[snip]
>>>It can do what you want, and then some. Warnings: there is a bit of a
>>It can't do anything right. Where have you been?
>I actually haven't encountered arguments against jQuery so far. I did
>recently move out into the sticks. I'll blame it on that. :-P
>
Okay. You have come to the right place.
> Quote: Quote:
>>>learning curve, and (much like Flash) because there's so much that you
>>Oh and it takes time to learn how to do everything wrong. Jeez, what
>>a waste.
>Is jQuery analogous to Flash, in that it can be used right, but often isn't?
>
No.
> Quote:
>Or do its flaws run deeper than that?
>
Much deeper. And whereas Flash has its reasonable uses (e.g.
photograph rendering) and the possibility of using feature testing and
progressive enhancement (but not with Adobe's deployment kit or any of
the open source libraries), jQuery is always useless (on the Web
certainly) and a surefire train wreck in all but a handful of desktop
browsers in their default configurations (try degrading gracefully
from an exception.) Furthermore, it encourages coding patterns that
are outrageously inefficient, its author is a known bumpkin, support
group is useless, etc., etc. In short, don't hitch your star to
*that* wagon.
>
As I said, where have you been? Don't they get network news in "the
sticks?"
Nope. I mean, we do get the news, but it's all via smoke signal. :-P
Prior to discovering jQuery, I always believed in rolling my own. I
recently did a comparison of the various JavaScript libraries, and it
seemed from my initial research that jQuery had the *opposite* reception
that you are suggesting. I don't frequent comp.lang.javascript (I got
into this thread via alt. www.webmaster), so perhaps this discussion is
old-hat to you guys.
Would you recommend another library, instead? Or would you suggest
sticking with the "roll-your-own" approach?
Anyhow, thank you for engaging me on this topic, rather than just saying
"Google it you moron" (or something to that effect)!
Thanks,
--
David Hennessy | | | | re: check boxes again
On Nov 19, 9:13*pm, David Hennessy <da...@FOADSPAMMERmaidix.com>
wrote: Quote:
David Mark wrote: Quote:
On Nov 19, 7:40 am, David Hennessy <da...@FOADSPAMMERmaidix.com>
wrote: Quote:
David Mark wrote:
>On Nov 18, 6:17 pm, David Hennessy <da...@FOADSPAMMERmaidix.com>
>wrote:
>>Patrick wrote:
>>>Trying this question again in a different way and expanding it to
>>>another newsgroup. Looking for how I would do this.
>>>For an html form;
>>>Say I have three check boxes A, B, and C . When I click on a checkbox a
>>>dropdown window will open next to it and the selections will be 1, 2,
>>>and 3. I want to use the same script and dropdown for each of the 3
>>>check boxes and be able to return values independent of each other.
>>>Meaning if I check box A and then select 2 it will return A and 2 for
>>>checkbox A. Then moving on to B I can check B and select 1, returning B
>>>and 1. I want to be able to do this for one two, or all of the
>>>checkboxes, but I only want the dropdowns displayed if the box is
>>>checked. Does that make any sense? Pointers, links or example scripts
>>>appreciated.
>>>Thanks again so much for your input.
>>If you're feeling adventurous, check out jQuery:
>You mean if you feel like tangling up your documents with a neophyte's
>first attempt at browser scripting, enjoy keeping constant vigilance
>on browser sniffing patches, then by all means check out jQuery (or
>Prototype or YUI.)
>[snip]
>>It can do what you want, and then some. Warnings: there is a bit of a
>It can't do anything right. *Where have you been?
I actually haven't encountered arguments against jQuery so far. I did
recently move out into the sticks. I'll blame it on that. :-P
> Quote:
Okay. *You have come to the right place.
> Quote: Quote:
>>learning curve, and (much like Flash) because there's so much that you
>Oh and it takes time to learn how to do everything wrong. *Jeez, what
>a waste.
Is jQuery analogous to Flash, in that it can be used right, but often isn't?
> > Quote: Quote:
Or do its flaws run deeper than that?
> Quote:
Much deeper. *And whereas Flash has its reasonable uses (e.g.
photograph rendering) and the possibility of using feature testing and
progressive enhancement (but not with Adobe's deployment kit or any of
the open source libraries), jQuery is always useless (on the Web
certainly) and a surefire train wreck in all but a handful of desktop
browsers in their default configurations (try degrading gracefully
from an exception.) *Furthermore, it encourages coding patterns that
are outrageously inefficient, its author is a known bumpkin, support
group is useless, etc., etc. *In short, don't hitch your star to
*that* wagon.
> Quote:
As I said, where have you been? *Don't they get network news in "the
sticks?"
>
Nope. I mean, we do get the news, but it's all via smoke signal. :-P
>
Prior to discovering jQuery, I always believed in rolling my own. I
Rolling your own what? Lets call them widgets. I will assume you
have some widgets from some previous browser scripting experience. Quote:
recently did a comparison of the various JavaScript libraries, and it
seemed from my initial research that jQuery had the *opposite* reception that you are suggesting.
Why are you comparing "JavaScript libraries?" I assume you mean the
handful of general-purpose libraries (e.g. jQuery, Prototype, etc.)
They are all pretty lousy scripts. If you are implying that there are
Web developers out there who swear by them, then you are correct.
Of course, these developers have no idea what they are doing. That's
why they use other people's scripts. A typical browser script is
written with a particular document structure in mind. Scripts should
be as small as possible (for obvious reasons), so the last thing that
should be in them is code written with any document in mind.
At a lower level, these things are tangled up with browser sniffing.
Why? Because their developers can't help themselves. They seem
compelled to create the biggest blob of generalized Javascript ever.
The idea behind it seems to be that "detecting" the user agent
(impossible) allows patching problems that cause one or more of the
handful of browsers supported to fail. The ideas that some things
can't be detected with script and that sacrificing all but a few
browsers to make it appear possible is ludicrous.
Then there is the sample code with the dollar signs that make function
calls look like variables. This stuff gets written up in blogs and
books, lots of people went to lots of effort to put it out there.
They couldn't all be giving out lousy advice, so why not copy and
paste it? Oops, they were giving out lousy advice.
When browsing the Web with an older PC, you can tell when you hit
sites as the fans rev up like a jet engine to cool down the
overheating CPU. And of course, these library-based sites usually
have triple-digit page weights, take forever to load and are always
susceptible new versions of the supported browsers. Bugs too.
Especially jQuery. Quote:
I don't frequent comp.lang.javascript (I got
And there you have it. Quote:
into this thread via alt. www.webmaster), so perhaps this discussion is
old-hat to you guys.
Never heard of that group. Likely not the best place to ask for a
review of a 50K blob of Javascript. Quote:
>
Would you recommend another library, instead? Or would you suggest
sticking with the "roll-your-own" approach?
Start with a valid, semantic document. Then decide what sort of
enhancements you want to make to that document. Start with little
things (special effects and drag and drop are useless in most
documents.) If you can't figure out some odd cross-browser quirk,
then ask here. Eventually you will have your own repository of
functions that is perfectly suited for the sorts of documents you
script.
You can Google for free code, but beware that much that is out there
is bunk. On a Web where huge companies bet their online presences on
an ersatz development like jQuery, it goes without saying that you
will encounter lots of rubbish. Seems everybody wants to be the next
clown who "solves" Javascript. The trouble is it isn't a puzzle.
Look for specific functions, not general-purpose libraries.
To save you some time, scratch jQuery, Prototype, Dojo, YUI, Overlib,
SWFObject (and that other one), MooTools and *anything* from Google
(OMG) off your list. Stay away from sites like Dynamic Drive as well. Quote:
>
Anyhow, thank you for engaging me on this topic, rather than just saying
"Google it you moron" (or something to that effect)!
Thanks for not saying "jQuery RULEZ" (or something to that effect.) | | | | re: check boxes again
Patrick wrote: Quote:
Jeff wrote: Quote:
>Patrick wrote: Quote:
>>Trying this question again in a different way and expanding it to
>>another newsgroup. Looking for how I would do this.
>>
>Usually people want to see some effort on your part. Quote:
>>>
>>For an html form;
>>>
>>Say I have three check boxes A, B, and C . When I click on a checkbox
>>
>That would be onclick;
>>
><input type="checkbox" onclick="doSomeJavascriptFunction(this)">
>>
> a Quote:
>>dropdown window will open next to it
>>
>Could be display: none
>>
>function doSomeJavascriptFunction(obj){
>>
>if(obj.checked){
> reference_to_rolldown.style.display = 'block';
> }else{
> reference_to_rolldown.style.display = 'none';
> }
>>
>}
>>
>where reference to rolldown might be:
>>
>document.getElementById('id_of_hidden_rolldown' )
>>
> and the selections will be 1, 2, Quote:
>>and 3. I want to use the same script and dropdown for each of the 3
>>check boxes and be able to return values independent of each other.
>>Meaning if I check box A and then select 2 it will return A and 2 for
>>checkbox A. Then moving on to B I can check B and select 1, returning
>>B and 1. I want to be able to do this for one two, or all of the
>>checkboxes, but I only want the dropdowns displayed if the box is
>>checked. Does that make any sense?
>>
>No.
>>
> Jeff
>>
>Pointers, links or example scripts Quote:
>>appreciated.
>>>
>>Thanks again so much for your input.
>>>
Jeff,
>
I have effort to show.
That's good. It looks like a nice effort.
It is at the link below. I have some of what you Quote:
have written. Perhaps you will be able to better understand the part of
my question you didn't understand.
Regretfully, I still don't understand what I don't understand!
Ajax is fine if you need to bring in content in the background on the
fly. I don't see a need for it here unless you need the server to shape
the data.
Cheers,
Jeff
Remember, the link is to a rough page |  | Similar JavaScript / Ajax / DHTML bytes | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,471 network members.
|