Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

style display checkbox - please help - 'd be simple

Status
Not open for further replies.

Technos

Programmer
Mar 15, 2002
47
US
Hey,

I have a checkbox like
<input type=&quot;checkbox&quot; name=&quot;chkRB&quot; onclick=&quot;javascript:display();&quot;>

I have a button which I don't want to show unless user clicks on any of these check boxes

I set

<input type=&quot;image&quot; src=&quot;btnnormal.gif&quot; style=&quot;display:none&quot; id=&quot;btnDecline&quot; name=&quot;btnDecline&quot;>


then in javascript I have


function display(){ document.frmGadgetRB.btnDecline.style.display = &quot;&quot;
}


And its not working. Please tell me what to do???
 
[lol] I'm back

anyways.
in the style you need to use visibility:hidden
<input type=&quot;image&quot; src=&quot;btnnormal.gif&quot; style=&quot;visibility:hidden&quot; id=&quot;btnDecline&quot; name=&quot;btnDecline&quot;>

then call it
function display(){ document.frmGadgetRB.btnDecline.style.visibility = &quot;visible&quot;
}


try that let us know _________________________________________________________
for the best results to your questions: FAQ333-2924
Is your question a most FAQ?? Find out here FAQ333-3048
 
sorry take out the style
function display(){ document.frmGadgetRB.btnDecline.visibility = &quot;visible&quot;
_________________________________________________________
for the best results to your questions: FAQ333-2924
Is your question a most FAQ?? Find out here FAQ333-3048
 
maybe it's the onclick needing to be onClick
rememebr that javascript is case sensitive
try this
<script language=&quot;javascript&quot;>
function display(){
document.getElementById('btnDecline').style.visibility='visible';
}
</script>
</head>
<body>
<form name=&quot;frmGadgetRB&quot;>


<input type=&quot;checkbox&quot; name=&quot;chkRB&quot; onClick=&quot;javascript:display();&quot;>
<input type=&quot;image&quot; src=&quot;btnnormal.gif&quot; id=&quot;btnDecline&quot; style=&quot;visibility:hidden;&quot;>
</form>

_________________________________________________________
for the best results to your questions: FAQ333-2924
Is your question a most FAQ?? Find out here FAQ333-3048
 
actually this syntax gives me errors also
document.frmGadgetRB.btnDecline.visibility='hidden';
thought it would be fine, been awhile sense I did it this way
_________________________________________________________
for the best results to your questions: FAQ333-2924
Is your question a most FAQ?? Find out here FAQ333-3048
 
I remember now
document.all.btnDecline.style.visibility='visible';

new it was something easy I was forgetting
_________________________________________________________
for the best results to your questions: FAQ333-2924
Is your question a most FAQ?? Find out here FAQ333-3048
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top