I am trying to only show a checkbox if another checkbox is checked. After that I want an input field to appear if the 2nd checkbox is checked, but one thing at a time. I cannot figure it out. Basically, If someone checks the "Purchase_Question" box, I want the "Try_On_Question checkbox to appear. Can anyone help me please?? I can't figure it out. Here is my code:
var o_checkbox = document.getElementById("Purchase_Question");
var o_co_app_firstname=document.getElementById("Try_On_Question");
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
pmyersjr
I am trying to only show a checkbox if another checkbox is checked. After that I want an input field to appear if the 2nd checkbox is checked, but one thing at a time. I cannot figure it out. Basically, If someone checks the "Purchase_Question" box, I want the "Try_On_Question checkbox to appear. Can anyone help me please?? I can't figure it out. Here is my code:
var o_checkbox = document.getElementById("Purchase_Question");
var o_co_app_firstname=document.getElementById("Try_On_Question");
if(o_checkbox.checked)
{
o_co_app_firstname.style.display = '' ;
}
else
{
o_co_app_firstname.style.display ='none';
}
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.