Results 1 to 4 of 4

Thread: Progress bar with checkboxes

  1. #1
    Join Date
    Nov 2005
    Posts
    40
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Progress bar with checkboxes

    Is there a code somewhere that creates a progress bar that fills up as people click on checkboxes?

    Essentially, I will have a single page with 10 questions. The person will check the first box and the bar or progress meter will say 1 of 10 complete. Then they will hit the next check box and will go to 2 of 10. If they click on say box 5, the first 4 will check off too and the meter will say 5 of 10. Also, is it possible to have it load with say with a certain number of them pre-checked? Like I can have a page with just the first one checked or the first 4 or the first 9?

    If not, how would I need to go about in doing something like this? Ajax? Any links that would help me with this? other than HTML and CSS I really don't know much about programming.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    If you know just a bit of javascript, this will work out for you:

    http://www.dynamicdrive.com/dynamici...lprogress2.htm

    If not, one of us can show you how.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Nov 2005
    Posts
    40
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    cool, this might be perfect.

    Is there a way so that for the links, I can have checkboxes instead? So if it is checked, it does incrCount(10) and when it is unchecked, it is decrCount(10)

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I don't like to micromanage if I don't have to, folks learn more when I don't. The basic way a checkbox works with javascript is:

    Code:
    <input type="checkbox" 
    onclick="if (this.checked){do_something}else{do_another_thing};">
    So I will take your word for it, that the two actions you want are:

    if it is checked, it does incrCount(10) and when it is unchecked, it is decrCount(10)
    Code:
    <input type="checkbox" 
    onclick="if (this.checked){incrCount(10)}else{decrCount(10)};">
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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