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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help with existing code

    Hey Guys,

    So I have a code i have been working on but I need to change it and its gotten me confused.....So far I have managed to get the code to show one drop down and then a text are below presenting information based on choice.

    What I want it to do now is have it so when an end user selects the first drop down it then populates a second drop down to choose from then displays the text below.

    So now its :-

    Select - choice1 - display text

    I'd like it to be select - choice 1 - choice 2 - display text based on the variable thats been chosen if that makes sense.

    The form is for blackberry device support checking so what i would like it to do is work like this :-

    Drop down 1 - Make ... if x make present specific models list
    Drop down 2 - Model... if x model present specific OS list
    Drop down 3 - OS ... dependent on OS choice display yes or not supported message
    Text Area - YES/NO

    Code:
    <p>
    <script type="text/javascript">// <![CDATA[
    function showSelect(){
    	for(var i=0;i<document.selectset.selectlist.length;++i){
    		if (document.selectset.selectlist[i].selected ){
    			document.getElementById("dispselectlist").firstChild.data=document.selectset.selectlist[i].value;
    			$j('#selected'+i).show();
    		}else {
                $j('#selected'+i).hide();
            }
    	}
    }
    // ]]></script>
    </p>
    <form name="selectset">
    <p><label class="label">Pick One: 
    <select id="ddlist" name="selectlist" onchange="showSelect();" class="inp"> 
    <option value="-" >Pick one</option> 
    <option value="Choice 1">Choice 1</option> 
    <option value="Choice 2">Choice 2</option> 
    <option value="Choice 3">Choice 3</option> 
    <option value="Choice 4">Choice 4</option> 
    <option value="Choice 5">Choice 5</option> 
    </select>
    </label></p>
    <p class="dispselect">Selected:<span id="dispselectlist">-</span></p>
    </form>
    <div id="selected1" class="inithide" style="display: none;">Choice 1 DIV</div>
    <div id="selected2" class="inithide" style="display: none;">Choice 2 DIV</div>
    <div id="selected3" class="inithide" style="display: none;">Choice 3 DIV</div>
    <div id="selected4" class="inithide" style="display: none;">Choice 4 DIV</div>
    <div id="selected5" class="inithide" style="display: none;">Choice 5 DIV</div>
    Last edited by mattd25; 10-20-2012 at 11:44 AM.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,243
    Thanks
    203
    Thanked 2,555 Times in 2,533 Posts
    You will find a triple-combo script at

    http://www.javascriptkit.com/script/...plecombo.shtml

    which you should be able to adapt.


    Family Planning Advice - Use Rear Entrance. Sign at Northhampton General Hospital.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Philip M View Post
    You will find a triple-combo script at

    http://www.javascriptkit.com/script/...plecombo.shtml

    which you should be able to adapt.


    Family Planning Advice - Use Rear Entrance. Sign at Northhampton General Hospital.
    Thanks but this has to be embedded into a specific area would it still work ?were in fact editing inside ZD and want the suppor articles to have something just like that :-D

    Also would it support mobile as the one Im using to test does not :-(

  • #4
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Bump for this one - thanks

  • #5
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,243
    Thanks
    203
    Thanked 2,555 Times in 2,533 Posts
    Quote Originally Posted by mattd25 View Post
    Thanks but this has to be embedded into a specific area would it still work ?were in fact editing inside ZD and want the suppor articles to have something just like that :-D

    Also would it support mobile as the one Im using to test does not :-(
    No idea. Why not try it? No reason why it should not work. No idea what you mean by ZD or suppor.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.


  •  

    Posting Permissions

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