Bouch
04-03-2003, 05:29 PM
I need to replace the "+" sign with a space and use the new string in a variable.
Example: I have color names in variables that are used to send the color name to a shopping cart: "shirtColor1 = Black", "shirtColor2 = Blue+Dusk", "shirtColor3 = Lime+and+Asphalt". I also need to use the same variables to display the color name in a dynamic text field - without the "+" signs.
So, I need to filter out the "+" sign and replace it with a space and assign the filtered color name to a variable that is displayed in a text field.
I have made an object with my color name:
function colorconvert (colornumber) {
var color = eval("_root.code.shirtcolor" + colornumber);
colorCode = new String(color);, I just don't know what to do next.
Am I on the right track? How do I create a find and replace function that will work on a variable amount of "+" signs.
Thanks,
Mike
Example: I have color names in variables that are used to send the color name to a shopping cart: "shirtColor1 = Black", "shirtColor2 = Blue+Dusk", "shirtColor3 = Lime+and+Asphalt". I also need to use the same variables to display the color name in a dynamic text field - without the "+" signs.
So, I need to filter out the "+" sign and replace it with a space and assign the filtered color name to a variable that is displayed in a text field.
I have made an object with my color name:
function colorconvert (colornumber) {
var color = eval("_root.code.shirtcolor" + colornumber);
colorCode = new String(color);, I just don't know what to do next.
Am I on the right track? How do I create a find and replace function that will work on a variable amount of "+" signs.
Thanks,
Mike