Jump to content

kyleseitz

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by kyleseitz

  1. I see. Everything is just in the one function. Is nrList defined to be 3 still?
  2. I understand what you mean, but to be honest, I'm not sure how to implement this
  3. here my js: var categories = [];categories["startList"] = ["Bob Long","BT Battle Tested","DLX Luxe","DYE","Empire","Invert","JT","MacDev","PlanetEclipse","Machine","Tippmann","Valken"]//Then I populate the models with a new drop down//Then I populate the colors with a new drop down var markLists = 3; // number of lists in the set function fillSelect(markerCat,markerList){var markstep = Number(markerList.name.replace(/\D/g,""));for (i=markstep; i<markLists+1; i++) {document.forms[0]['List'+i].length = 1;document.forms[0]['List'+i].selectedIndex = 0;}var markCat = categories[markerCat];for (each in markCat) {var markOption = document.createElement('option'); var markData = document.createTextNode(markCat[each]); markOption.setAttribute('value',markCat[each]); markOption.appendChild(markData); markerList.appendChild(markOption); } } function getValue(isValue) {alert(isValue);} function init() {fillSelect('startList',document.forms[0]['List1'])} navigator.appName == "Microsoft Internet Explorer" ? attachEvent('onload', init, false) : addEventListener('load', init, false); //For my second section, I want a checkbox to show this //Hopper Brandvar hopper = [];hopper["startList2"] = ["DYE","Empire","Virtue"] //Then I populate the models with a new drop down//Then I populate the colors with a new drop down var hopLists = 3; // number of lists in the set function fillSelect(hopperCat,curhopperList){var hopstep = Number(curhopperList.name.replace(/\D/g,""));for (j=hopstep; j<hopLists+1; j++) {document.forms[0]['hopperList'+j].length = 1;document.forms[0]['hopperList'+j].selectedIndex = 0;}var hopCat = hopper[hopperCat];for (each in hopCat) {var hopOption = document.createElement('option'); var hopData = document.createTextNode(hopCat[each]); hopOption.setAttribute('value',hopCat[each]); hopOption.appendChild(hopData); curhopperList.appendChild(hopOption); } } function getValue(isValue) {alert(isValue);} function init() {fillSelect('startList2',document.forms[0]['hopperList'])} navigator.appName == "Microsoft Internet Explorer" ? attachEvent('onload', init, false) : addEventListener('load', init, false); my html: <!--!!!!!!!!!!!!!!!!!!!!!!! MARKER BUILD !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!--><form action=""><select name='List1' onchange="fillSelect(this.value,this.form['List2'])"><option selected>-Choose Your Marker-</option></select> <select name='List2' onchange="fillSelect(this.value,this.form['List3'])"><option selected>-Choose Your Model-</option></select> <select name='List3' onchange="getValue(this.value)"><option selected >-Pick a Color/Option-</option></select></form> <!--!!!!!!!!!!!!!!!!!!!!! HOPPER BUILD !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!--> <input type="checkbox" id="hopcheck" onClick="showHide('hopcheck')/"/><label for "hoppercheck">Add a Hopper</label> <form action=""><select name='hopperList1' onchange="fillSelect(this.value,this.form['hopperList2'])"><option selected>-Choose Your Hopper Manufactuer-</option></select> <select name='hopperList2' onchange="fillSelect(this.value,this.form['hopperList3'])"><option selected>-Choose Your Hopper Model-</option></select> <select name='hopperList3' onchange="getValue(this.value)"><option selected >-Pick a Hopper Color/Option-</option></select></form>
  4. It's not live anywhere. It's just saved locally to my machine under 2 documents (.html and .js). I'm trying to get this to work so I can do some other things with it before I make it live. I've found bits and pieces of my code from other sources, and like I said I'm fairly new to html and even newer to javascript. I'm sort of in a bind. If you copy and paste them into a notepad and save it under the appropriate extension, and comment out one of them, you can see one of the lists populates (if you comment the other one respectively, the other list works). I'm trying to both: get these lists to populate themselves andshow the second list based on the status of the checkbox.
  5. Hey i've been researching this for a while and haven't been able to find a solution that works for me, I actually have 2 problems; Goal: Display 3 drop down boxes - the second value is dependent on the first and the third on the second.Display 3 checkboxes - When each/any are checked, display 3 dropdowns with the same specifications as the one that always shows up. Problem: If I comment out one of the dropdown codes, the other will work.Checkbox will not show/hide other dropdowns. I'm pretty new to javascript/html. Here's my Fiddle. I currently have 1 checkbox but if somebody can help me get that one going, I'm sure I can model that to get the other 2 to work. ANY help would be appreciated - Please! Fiddle:http://jsfiddle.net/kyleseitz/SLY95/
×
×
  • Create New...