Closed Thread Icon

Topic awaiting preservation: radio buttons greyed out? Pages that link to <a href="https://ozoneasylum.com/backlink?for=8465" title="Pages that link to Topic awaiting preservation: radio buttons greyed out?" rel="nofollow" >Topic awaiting preservation: radio buttons greyed out?\

 
Author Thread
diosa
Obsessive-Compulsive (I) Inmate

From: sacramento, ca, usa
Insane since: Jan 2003

posted posted 01-16-2003 18:08

maybe this can be done and maybe not... hopefully someone can give me some sort of suggestion.

i'm designing a website for this company... on their signup page, it has the option to select a gold, silver, or bronze user account, obviously having different prices, and depending on which you select, your free gift options change. for instance, bronze users get free gifts of like 15 dollar value, gold get 30 dollar value gifts.

on the signup page, the first thing is radio buttons where yous select your account level, and beneath that is a set of buttons with all the gifts. what they want to do is have all the silver and gold gift buttons greyed out if you've selected bronze, and so forth. i'd like to know if this is possible, and what would happen if a user had java disabled even if this was possible through java.

i'd also like to know if anyone has solutions other than greying out buttons, so users can only select their appropriate gifts.

input would be greatly appreciated, thanks

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 01-16-2003 18:34

First of all, you're referring to "JavaScript," which is very, very different from "Java."

Now, this can be done, but not reliably. (For instance, if the user has JavaScript turned off, they'll be able to bypass it.) Since it can't be done reliably, you will need some sort of server-side script to give them an error if they select an illogical set of options. Nonetheless, the following techniques will help to guide users who have javascript turned on:

1. You can gray-out the buttons, at least in Internet Explorer. If you have a reference to the button (for instance,

var disallowedbutton = document.myformname.mybuttonname;

), then you can disable it as follows:

disallowedbutton.disabled = true; // or false, depending.

2. If that doesn't work in all browsers, you can completely visibly remove the button from the page:

var disallowedbutton = document.myformname.mybuttonname;
//either:
disallowedbutton.style.visibility = 'hidden'; // hides the button but it still takes up space
//disallowedbutton.style.visibility = 'visible'; // undoes the previous line
//or:
disallowedbutton.style.display = 'none'; // hides the button and it no longer takes up space
disallowedbutton.style.display = 'inline'; // undoes the previous line

But again, these methods are not foolproof, and shouldn't be relied on to keep the user from doing something he shouldn't be able to do.

diosa
Obsessive-Compulsive (I) Inmate

From: sacramento, ca, usa
Insane since: Jan 2003

posted posted 01-16-2003 19:40

i am aware of the difference, but often i have a lazy tounge, or in this case, fingers, and just say java. thanks for the help.

« BackwardsOnwards »

Show Forum Drop Down Menu