Jump to content

vchris

Members
  • Posts

    1,529
  • Joined

  • Last visited

Everything posted by vchris

  1. 2 process??reserveList = document.createElement('select');process = document.getElementById('process');processLength = process.options.length;processGroup = document.getElementById('processGroup');process = document.getElementById('process');I'm guessing that's an error.
  2. I don't think process is being declared more than once. <cfparam name="processGroup" default=""><cfparam name="sourceName" default=""><script language="javascript"><!-- Function that makes certain form elements appear -->function showElements() { if(document.getElementById('docType').value == 20){ document.getElementById('estMethodContainer').style.display = 'block'; } else { document.getElementById('estMethodContainer').style.display = 'none'; }}function toggleVisible(itemName) { <!-- Erase containers on new selection --> document.getElementById('sourceTypeContainer').style.display = 'none'; document.getElementById('CASNumberContainer').style.display = 'none'; document.getElementById('ISICCodeContainer').style.display = 'none'; document.getElementById('processGroupContainer').style.display = 'none'; document.getElementById('processContainer').style.display = 'none'; document.getElementById('areaSourceContainer').style.display = 'none'; document.getElementById('docTypeContainer').style.display = 'none'; document.getElementById('estMethodContainer').style.display = 'none'; switch(itemName) { <!-- Source Classification --> case 'Point Source': document.getElementById('sourceTypeContainer').style.display = 'block'; break; case 'Non-Point Source': document.getElementById('areaSourceContainer').style.display = 'block'; document.getElementById('docTypeContainer').style.display = 'block'; break; <!-- Source Types --> case 'Industry': document.getElementById('sourceTypeContainer').style.display = 'block'; document.getElementById('ISICCodeContainer').style.display = 'block'; document.getElementById('docTypeContainer').style.display = 'block'; break; case 'Industrial Process/Activity': document.getElementById('sourceTypeContainer').style.display = 'block'; document.getElementById('processGroupContainer').style.display = 'block'; document.getElementById('processContainer').style.display = 'block'; document.getElementById('docTypeContainer').style.display = 'block'; document.getElementById('estMethodContainer').style.display = 'block'; break; case 'Chemicals': document.getElementById('sourceTypeContainer').style.display = 'block'; document.getElementById('CASNumberContainer').style.display = 'block'; document.getElementById('docTypeContainer').style.display = 'block'; break; }}var i;var reserveListLoaded = false;var reserveList = document.createElement('select');var processLength = document.getElementById('process').options.length;var processGroup = document.getElementById('processGroup');var process = document.getElementById('process');function removeOptions(){ for(i=processLength-1;i>=0;i--) { if(processGroup.options[processGroup.selectedIndex].value != process.options[i].value && process.options[i].value != 'default' && processGroup.options[processGroup.selectedIndex].value != 'default') { process.remove(i); } }}function restoreOptions(){ if(!reserveListLoaded) { reserveListLoaded = true; for(i=0;i<process.options.length;i++) { reserveList.options[i] = process.options[i]; } } for(i=0;i<reserveList.options.length;i++) { process.options[i] = null; process.options[i] = reserveList.options[i]; }}function processGroupOnChange(){ restoreOptions(); removeOptions();}</script>...<div id="processGroupContainer"> <p><label>Process Group <span class="star">*</span></label> <select name="processGroup" id="processGroup" onchange="processGroupOnChange();"> <option value="default">Make a Selection</option> <cfoutput query="getProcessGroup"> <option value="#getProcessGroup.ProcessGroup_Code#">#getProcessGroup.Description_E#</option> </cfoutput> </select></p> </div> <div id="processContainer"> <p><label>Process <span class="star">*</span> <span class="small"><a href="/pdbis/oecd/oecd/admin/addproc.cfm" target="_blank" id="addProcessLink">Add Process</a></span></label> <select name="process" id="process"> <option value="default">Make a Selection</option> <cfoutput query="getProcess"> <option value="#getProcess.ProcessGroup_Code#">#getProcess.Description_E#</option> </cfoutput> </select></p> </div>...
  3. Yes I have a select with id process. I will recopy your code.Still getting error: Error: document.getElementById("process") has no propertiesWhich is the arrowed line. var process = document.getElementById('process');...for(i=processLength-1;i>=0;i--) { if(processGroup.options[processGroup.selectedIndex].value != process.options[i].value && process.options[i].value != 'default' && processGroup.options[processGroup.selectedIndex].value != 'default') { process.remove(i); <------------- } }...<select name="process" id="process">... It's funny because that part worked fine before.
  4. Thanks a lot aspnetguy for the help. I pasted the code and still have some errors.Error: reserveList.options has no propertiesError: process has no propertiesThe only thing I changed was the removeOptions function. I added the onchange in processGroup select. var i;var reserveListLoaded = false;var reserveList = new Array();var processGroup = document.getElementById('processGroup');var processLength = document.getElementById('process').options.length;var process = document.getElementById('process');function removeOptions() { for(i=processLength-1;i>=0;i--) { if(processGroup.options[processGroup.selectedIndex].value != process.options[i].value && process.options[i].value != 'default' && processGroup.options[processGroup.selectedIndex].value != 'default') { process.remove(i); } }}function restoreOptions() { if(!reserveListLoaded) { reserveListLoaded = true; for(i=0;i<process.options.length;i++) { reserveList.options[i] = process.options[i]; } } for(i=0;i<reserveList.options.length;i++) { process.options[i] = null; process.options[i] = reserveList.options[i]; }}function processGroupOnChange(){ restoreOptions(); removeOptions();}
  5. vchris

    PS 3

    I have found the best deal ever for a playstation 3! http://cgi.ebay.ca/PS3-PlayStation-3-60GB-...1QQcmdZViewItemOnly 100 million $ pretty cheap! Crazy people!
  6. Forget it. My error. I had a major typo in the path :)Works now!
  7. I tried mappings and it didn't work when I tried my absolute path.my mapping: /mysitehtml code: @import url("/css/mysite.css")didn't work.
  8. Anyone know or if it's even possible to configure absolute paths in ColdFusion MX 7 Dev Edition?
  9. Ok now I see everything is there but how come it's not refilling the select onChange? function removeOptions(selectbox){ var i; var myOptionsText = new Array(); var myOptionsValue = new Array(); var processLength = document.getElementById('process').options.length; var process = document.getElementById('process'); for(i=0;i<processLength;i++) { myOptionsText[i] = process.options[i].text; myOptionsValue[i] = process.options[i].value; var option = new Option(myOptionsText[i],myOptionsValue[i]); process.options[processLength-1] = option; /*document.write(option.value + ' - ' + option.text + '<br>');*/ } for(i=processLength-1;i>=0;i--) { if(selectbox.options[selectbox.selectedIndex].value != process.options[i].value && process.options[i].value != 'default' && selectbox.options[selectbox.selectedIndex].value != 'default') { process.remove(i); } }}
  10. Doesn't seem to work. I did an output of option and I get [object HTMLOptionElement] for(i=0;i<processLength;i++) { myOptionsText[i] = process.options[i].text; myOptionsValue[i] = process.options[i].value; var option = new Option(myOptionsText[i],myOptionsValue[i]); process.options[processLength-1] = option; document.write(option + '<br>');}
  11. Thanks aspnetguy, that solved my problem. How would your method of adding options in a select work.var option = new Option("Option One","1");I want to add options in a select called process. I want to add them with my loop.I got this: var processLength = document.getElementById('process').options.length;var process = document.getElementById('process');for(i=0;i<processLength;i++) { myOptionsText[i] = process.options[i].text; myOptionsValue[i] = process.options[i].value; process.options.add(myOptionsText[i], myOptionsValue[i]);}
  12. Same issue. I declared this variable up top earlier: var processLength = document.getElementById('process').options.length;
  13. Jesh, I'm working on your suggestion but I got an error that I don't really understand. It happens here:var process = document.getElementById('process');for(i=0;i<=processLength;i++) { myOptionsText[i] = process.options[i].text; myOptionsValue[i] = process.options[i].value;}
  14. vchris

    Photoshop CS 2

    Here's a screen shot of what I want. No it's not the desktop icons. It's the photoshop cs2 software itself. I want to know if the gray background of the app can be transparent.
  15. vchris

    Photoshop CS 2

    Not the background of the shortcut. The Canvas!
  16. No it keeps the options in select 2 with the same value.My problem right now is that I only remove so if you choose another option in select 1 well select 2 will be empty. I need to re-add all the options in select 1 onChange before I remove them. I need a 2 dimensional array to store the text and value of options in select 2. So now when the user chooses an option in select 1 it will show appropriate options in select 2. for(i=0;i<=processLength;i++) { for(j=0;i<=1;j++) { myOptions[i][j] = process.options[i].value; }} I get an error saying myOptions has no properties.
  17. Now the problem comes with the adding of options in the select. I guess I'll need a 2 dimensional array for value and text. The array should get filled at the beginning of the loop before removing the options so I have all of the options in my array. Every time someone changes option in the 1st select the option in the 2nd select should reappear and then removed depending on the selection in the 1st select.I don't have a lot of knowledge about 2 dimensional array. Would this work with only 1 loop? How do I set the value for 2 dimensions? See the example below.This is what I got: for(i=0;i<=processLength;i++) { myOptions[i][i] = process.options[i].value;}
  18. What do you mean by the page gets navigated?
  19. vchris

    Photoshop CS 2

    What I mean is instead of the gray background not the rest. Basically instead of the gray it's my desktop.
  20. vchris

    Photoshop CS 2

    Is there a way in PS CS 2 on windows xp to have the background of the app transparent? I think it's like that on a mac, well can it be done on a pc?
  21. Woot! :)Thank you very much!
  22. I installed CF as a stand alone web server but where exactly do I put the pages so they can be read by CF? I checked the references and couldn't find much.
  23. I get this JS error: Error: process.options has no properties in here if(selectbox.options[selectbox.selectedIndex].value != process.options.value && process.options.value != 'default' && selectbox.options[selectbox.selectedIndex].value != 'default') {EDIT:I just thought about this. One of the choices should remove all of them and when I have only the i outputted it outputs 0-19, what it should output basically. Then when I add process.remove(i); the output is 1-10, 0 being "Make a Selection" so it skips it. Does it only go up to 10 because I am removing 1 option per loop?If I have 20 options in a select. I remove #1 does #2 become #1? If so that would explain my problem. Then how would I solve this?EDIT:Issue resolved. That was my problem. I went backwards instead. Started from length to 0.
×
×
  • Create New...