numero = 66916
interpreted = N
texte = Donovan,I'm a bit confused about what exactly you're trying to do? Do you have a working example I could look at? I'd be happy to assist, but I'm having a hard time figuring out what the end result should be?Do you want multiple select lists, with a depenency relationship? Are the colors and sizes stored in a database or are you going to hard code them?Maybe something like AJAX or Matt Kruse's DynamicOptionList.js is what you're looking for?http://www.clearnova.com/ajax/http://www.javascripttoolbox.com/lib/dynamicoptionlist/MarcDonovan Brooke wrote:> Donovan Brooke wrote:> >> Marc Thompson wrote:>>>>> OK, I couldn't stand it. The code I wrote quickly didn't work so I >>> went ahead fixed. Look here:>>> http://www.utah.edu/wc/choose.html>>>>>> Marc> > > > Hey Marc,> I'm finally getting around to working on this issue again. Thanks for the> code. This is a good start. However, I need to figure out some way> of identifying the right image name based off the color select value.> So, starting from your code below:> > > > -- the function:> > -- > > -- the Call:> > -- > > > > Can this be changed to an array that prepopulates both color and the > image name?> > For example,> Here is some code that populates data to another form select:> -- START CODE:> [!] ** Sample Array> arrayData[0] = 'RED|X Large|'> arrayData[1] = 'Blue|Small|'> arrayData[2] = 'Blue|Large|'> arrayData[3] = 'Blue|XX Large|'> ** [/!]> > function populateData( __COLOR ) {> select = window.document.size_color.__SIZE;> string = "";> // 0 - will display the new options only> // 1 - will display the first existing option plus the new options> count = 0;> // Clear the old list (above element 0)> select.options.length = count;> // Place all matching categories into Options.> for( i = 0; i < arrayData.length; i++ ) {> string = arrayData[i].split( "|" );> if( string[0] == __COLOR ) {> select.options[count++] = new Option( string[1] );> }> }> // Set which option from subcategory is to be selected> // select.options.selectedIndex = 2;> // Give subcategory focus and select it> // select.focus();> }> -- END CODE> > > > > Notice the pipe delimiter. The code above first matches the color,> then the pulls the value to populate into the other select menu.> I would like to convert this so that I can match the color and pull the> adjacent image name to change the image. I can create the array easy> enough but my javascript is pretty lacking. I'll be working on it> but if anyone can easily tackle it, I'd appreciate it.> > Donovan> > > -- -------------------------------------------Marc ThompsonSoftware EngineerOffice of Information TechnologyUniversity of Utah801.585.9264marc.thompson@utah.edu--------------------------------------------------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
Donovan,I'm a bit confused about what exactly you're trying to do? Do you have a working example I could look at? I'd be happy to assist, but I'm having a hard time figuring out what the end result should be?Do you want multiple select lists, with a depenency relationship? Are the colors and sizes stored in a database or are you going to hard code them?Maybe something like AJAX or Matt Kruse's DynamicOptionList.js is what you're looking for?http://www.clearnova.com/ajax/http://www.javascripttoolbox.com/lib/dynamicoptionlist/MarcDonovan Brooke wrote:> Donovan Brooke wrote:> >> Marc Thompson wrote:>>>>> OK, I couldn't stand it. The code I wrote quickly didn't work so I >>> went ahead fixed. Look here:>>> http://www.utah.edu/wc/choose.html>>>>>> Marc> > > > Hey Marc,> I'm finally getting around to working on this issue again. Thanks for the> code. This is a good start. However, I need to figure out some way> of identifying the right image name based off the color select value.> So, starting from your code below:> > > > -- the function:> > -- > > -- the Call:> > -- > > > > Can this be changed to an array that prepopulates both color and the > image name?> > For example,> Here is some code that populates data to another form select:> -- START CODE:> [!] ** Sample Array> arrayData[0] = 'RED|X Large|'> arrayData[1] = 'Blue|Small|'> arrayData[2] = 'Blue|Large|'> arrayData[3] = 'Blue|XX Large|'> ** [/!]> > function populateData( __COLOR ) {> select = window.document.size_color.__SIZE;> string = "";> // 0 - will display the new options only> // 1 - will display the first existing option plus the new options> count = 0;> // Clear the old list (above element 0)> select.options.length = count;> // Place all matching categories into Options.> for( i = 0; i < arrayData.length; i++ ) {> string = arrayData[i].split( "|" );> if( string[0] == __COLOR ) {> select.options[count++] = new Option( string[1] );> }> }> // Set which option from subcategory is to be selected> // select.options.selectedIndex = 2;> // Give subcategory focus and select it> // select.focus();> }> -- END CODE> > > > > Notice the pipe delimiter. The code above first matches the color,> then the pulls the value to populate into the other select menu.> I would like to convert this so that I can match the color and pull the> adjacent image name to change the image. I can create the array easy> enough but my javascript is pretty lacking. I'll be working on it> but if anyone can easily tackle it, I'd appreciate it.> > Donovan> > > -- -------------------------------------------Marc ThompsonSoftware EngineerOffice of Information TechnologyUniversity of Utah801.585.9264marc.thompson@utah.edu--------------------------------------------------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Marc Thompson
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...