I am trying to add some php code to the location of the ‘selected’ text would be in each list item, the problem I have is the ‘value=""’ after each <option, the first addition of code is fine but every list item entry thereafter in the same menu and any other menus on the page has the 'value="" after the insertion, so the first menu list would be something like:
>my value1 value="my value2">my value2 value="my value3">my value3and any other like this:
value="my value1">my value1 value="my value2">my value2 value="my value3">my value3when they should look like:
>my value1 >my value2 >my value3The code I am using is:
var allMenuOptions = theListTag.fwFindAll(“option”);
for (n in allMenuOptions) {
menuOption = allMenuOptions[n];
if (menuOption.value) {
var menuValue = menuOption.value;
var menuValueAsStr = menuOption.value.toString();
var insertLoc = menuOption.fwAddRaw("",menuValue); // Use menu value... unconverted toString()
insertLoc.fwAddRaw("<? code here ?>");
if (menuOption.selected) {
menuOption.selected.fwDelete();
}
}
}
I have a workaround where I delete the value parameters and then add them again with the code but this then adds a second space before the value="", this is probably not important… I was more interested in wondering why the code above didn’t work.
The workaround code is:
var allMenuOptions = theListTag.fwFindAll(“option”);
for (n in allMenuOptions) {
menuOption = allMenuOptions[n];
if (menuOption.value) {
var menuValue = menuOption.value;
var menuValueAsStr = menuOption.value.toString();
var optSelCode = menuOption.fwAddRaw("",menuValue);
menuOption.value.fwDelete();
menuOption.value=menuValue+"<? code here ?>";
if (menuOption.selected) {
menuOption.selected.fwDelete();
}
}
}
Anyone any ideas on why this is or if it is a bug… or maybe me?
Sorry about the way the code is coming out, just can’t get me head around how to insert code properly!
Mike
actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options