I am having a problem with passing a string as a variable. Let me do a bit of explaining on why to avoid any confusion. I have several flash objects on my page all named and identified differently (ex. 'OnTime', 'ncr', 'intq', 'exq'). I have a js function that dynamically updates the xml content these flash objects are reading. Below is how/what i am passing.
<input type='button' value='Go' onClick='javascript:updateCXML(ObjectName, JS var containing XML);'
Here is where my problem comes in. I have a select box that users choose from to update the Flash object (ex. jan, feb, mar). When I populate the select box using ASP(vbscript) the value of the options are actually names of js variables (ex. OnTimemarch2006, ncrmar2006). Everything works as expected except when i click the 'Go' button i pass the name/id of the Flash object, then i use "javascript:updateCXML(ObjectName, document.getElementByID('select box ID').value);"
This passes a string to the function, when I want it to actually pass a variable therefore my function does not work. How can I convert a string to a variable? I hope this makes since. The actual code is below.
<input type='button' value='Go' onClick='javascript:updateCXML(ObjectName, JS var containing XML);'
Here is where my problem comes in. I have a select box that users choose from to update the Flash object (ex. jan, feb, mar). When I populate the select box using ASP(vbscript) the value of the options are actually names of js variables (ex. OnTimemarch2006, ncrmar2006). Everything works as expected except when i click the 'Go' button i pass the name/id of the Flash object, then i use "javascript:updateCXML(ObjectName, document.getElementByID('select box ID').value);"
This passes a string to the function, when I want it to actually pass a variable therefore my function does not work. How can I convert a string to a variable? I hope this makes since. The actual code is below.
Code:
[/b]
<select id="otd">
<option value="strxmlontimejanuary2006">january</option>
<option value="strxmlontimefebruary2006">february</option>
<option value="strxmlontimemarch2006"selected>march</option>
</select>
<input value="Go" type="button" onClick="javascript:setFCNewData('OnTime', [b]document.getElementById('otd').value);[/b]" />
[b][Code end][/b]
Thank you in advance for any feedback.