Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Oct 2002
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question I check this box, another pops up next to it

    I have a form and in one section, they first fill in their name. It then has a checkbox beside the textbox and a question "Is this your first time attending?" (it's for a meeting registration) I would like to have it so if the user checks this box saying they are attending for the first time, a second checkbox appears next to the first one, and a question like "Would you like to receive previous meeting programs?"

    Now, the reason I want it like this is because the people filling out this form are, to be blunt, slow. We like to keep things very simple when dealing with them. I don't want to put the extra check box if they don't need to see it (which they don't unless they check the first one).

    Is this possible? Can anyone please give me some code to show me how it's done? I would really appreciate it!

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Is this any good?




    <script>
    function ischk(){
    if(document.f1.c1.checked==true){
    document.f1.c2.style.visibility="visible"
    }
    else{
    document.f1.c2.style.visibility="hidden"
    }
    }
    </script>

    <form name="f1">
    <input type="text" name="t1">
    <input type="checkbox" name="c1" onclick="ischk()">
    <input type="checkbox" name="c2" style="visibility:hidden">
    </form>



  • #3
    New Coder
    Join Date
    Oct 2002
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Cool deal, it works perfectly! Thanks!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •