Email conversation
From | Vincent Yuan |
To | Me |
Subject | Radio, Check Buttons On and Off and Re-direct script Help for Office Guidelines |
Date | 18 October 2006 05:40 |
Hi, Thank you for the awesome tutorial you showed on your site. I need some
additional help on another thing. I've been trying to learn more about radio
buttons and check boxes and came across a java script like this:
<SCRIPT LANGUAGE="JavaScript">
function showMe (it, box) {
var vis = (box.checked) ? "block" : "none";
document.getElementById(it).style.display = vis;
}
</script>
I use this to hide some of the options the user on the site clicks or
selects on the radio and check boxes i've placed. I need to know then if it
is possible that not only will it hide or show divisions on a page like i
had on top but also open another website on a frame window.
I know its complicated but what I hope you can help is like this:
1. user goes to website with 3 columned frames.
2. he goes to the check box selection and checks one item, it then shows the
hidden division (<div></div> ) below the check box on the same frame he had
place the check on but on the 3rd column frame the website changes into a
description of what he had checked. More like an instruction of what he
needs to do since what I am making is a simple how to website where people
can order discs and how they can reach the buyers.
We have multiple users on the site and the second most of all is that can it
be implemented to radio button selections as well? We want to make it clean
and simple which would not confuse all users and the like.
But to make it short:
Would it be possible like for radio buttons and check boxes have multiple
commands on it for the "onClick=<command>" syntax? I know this would be
possible for javascript but I'm hoping you could help.
Please reply soon. Thank you so much for the information you've already
provided
Max
From | Me |
To | Vincent Yuan |
Subject | Re: Radio, Check Buttons On and Off and Re-direct script Help for Office Guidelines |
Date | 21 October 2006 11:53 |
Vincent,
> Would it be possible like for radio buttons and check boxes have multiple
> commands on it for the "onClick=<command>" syntax? I know this would be
> possible for javascript but I'm hoping you could help.
Not entirely sure I like what you are proposing. It sounds confusing enough
by email when you have described it at length. It will probably be confusing
to a user as well. However, yes, onclick can have as many commands as you
need:
onclick="whatever();whatever2();whatever3(foo);"
Unrelated, but make sure that by default, all content is visible, then hide
it just before the end of the BODY, that way, any browser that is not
capable of running the script, will still show the content:
<script type="text/javascript">
if(document.getElementById) {
document.getElementById('foo').style.display = 'none';
document.getElementById('bar').style.display = 'none';
document.getElementById('baz').style.display = 'none';
document.getElementById('qux').style.display = 'none';
...
}
</script>
</body>
Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/