Page 1 of 1

radio buttons

Posted: Thu Apr 24, 2003 3:52 am
by wizzard
Hello,

I'm working on my shopping cart and i want something if the user
Choose the creditcard radio button then he can choose from the shipment method also with radio buttons ups, express mail buttons. If he choose COD he can only choose express mail. I don't know if this is possible with javascript and it will works for iexplorer and netscape.

Regards
Kris

Posted: Thu Apr 24, 2003 5:01 am
by patrikG
You can disable form-elements from javascript.

Check this for code-samples:

http://www.codetoad.com/javascript/enab ... lement.asp

Posted: Thu Apr 24, 2003 5:27 am
by wizzard
And hiding fields?

Posted: Thu Apr 24, 2003 6:00 am
by patrikG
hidden form-fields cannot be disabled or trigger events.

Posted: Thu Apr 24, 2003 6:03 am
by wizzard
i mean can you hide fields with javascript? Like when the user press a button that some fields are hidden

Posted: Thu Apr 24, 2003 6:51 am
by patrikG
Never tried it - I find it hard to image that that would work, but do give it a try and let post your experience! :)

Posted: Thu Apr 24, 2003 8:47 am
by d1223m
yes it does definatly work

Code: Select all

<input type="button" value="a button" onclick="hideme(this)">
<script language="javascript">
function hideme(obj) &#123;
  obj.style.visibility="hidden";
&#125;
</script>
all css attributes are available thru javascript
you may also want to set obj.style.display="none" to completly remove the object from the normal flow.
check the w3c pages for css level1 and 2 reference