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 to the CF scene
    Join Date
    Sep 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Yet Another Triple box Javascript question

    I coded this boxes with several layers.. is there any way i can add a "add button" that will let me add this to a table with figures? Example:

    The dropdown boxes and selection:
    triplebox1 2 3
    [example] [stage1] [stage2]
    1st layer [nike] [$100]
    [shoe] [shoe 2] [$200] [Add]
    [shoe 3] [300]

    so on and so forth..


    let say I choose Shoe Nike that cost 100.00

    I have the Add button to post to the label on a form on the SAME page.

    Form below the dropdownbox

    description | Price
    ---------------------------------------------------
    Shoe Nike | 100.00
    ---------------------------------------------------
    Total |100.00


    I asked this on the asp.net section by mistake. Thanks for the help in advance.

  • #2
    Regular Coder
    Join Date
    May 2005
    Posts
    100
    Thanks
    0
    Thanked 0 Times in 0 Posts
    uh..here's something small, hope it helps you out:

    Code:
    <form name='form1'>
    <select name='sel' onchange='poo()'>
    <option value='value1' id='v1'>value1</option>
    <option value='value2' id='v2'>value2</option>
    <option value='value3' id='v3'>value3</option>
    <option value='value4' id='v4'>value4</option>
    </select></form>
    
    <div id='value1' style='display:none'>
    Option1 information
    </div>
    <div id='value2' style='display:none'>
    Option4 information
    </div>
    <div id='value3' style='display:none'>
    Option3 information
    </div>
    <div id='value4' style='display:none'>
    Option2 information
    </div>
    
    <script>
    function poo(){
    document.getElementById(document.form1.sel.options[document.form1.sel.selectedIndex].value).style.display="block";
    }
    </script>

  • #3
    New to the CF scene
    Join Date
    Sep 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes yes! very close. I want them to be null untill you press a "Add button"

    then it will post to a label. So basically a user can choose his choices from three dropdown lists then he presses the add button. The add button then knows what 3 captions the user has chosen, and texts it in a label to be viewed in a form with the totals(Kinda like a shopping cart). Thanks in advance.


  •  

    Posting Permissions

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