FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Show Fields only if checkbox selected
#1
Hello everyone,

is it possible to show one or more fields in a form only if a checkbox is activated?

Thanks in advance for your help.
Cubitus
Reply
#2
You can do this with javascript using a function like:
function RBtnCk(info) {
var N = info.name;
var YN = info.value; // alert(N+' : '+YN);
var show = 'none';
if (YN == 'No') { show = 'block';
document.getElementById(N+'Text').style.display = show;
}
}

then calling it from your radio button with:
onclick="RBtnCk(this)"

and assign the same id+Text to it as the radio button. Example:
radio button code: input name="r1" type="radio" value="No" onclick="RBtnCk(this)"
hidden area code: table id="r1Text" style="display:none"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)