Javascript Pro Question - Load CSV based on drop down selection
Hi All,
I'm struggling to come up with a solution, and wondered if one of you pro's could help out. I have a function that will load a different CSV file in to the grid:
So the bit i need assistance with is the code required to generate the onClick URL in this format: 'mycolour variable' + '_' + 'myshape variable' + '.csv'
Any ideas?
I'm struggling to come up with a solution, and wondered if one of you pro's could help out. I have a function that will load a different CSV file in to the grid:
function load(url){
table.setURL(url);
table.request();
}
<button onClick="load('http://URLTONEWFILE.CSV')">Load New File</button>
[code]
This works perfectly, however I need to take it a step further to load CSV files, based on user choices from two drop down boxes. Something like this:
[code]<form name="myform"">
<select name="mycolour">
<option value="red">RED</option>
<option value="yellow">YELLOW</option>
<option value="blue>BLUE</option>
</select>
<select name="myshape">
<option value="square">SQUARE</option>
<option value="circle">CIRCLE</option>
<option value="triangle">TRIANGLE</option>
</select>
<button onClick="load('http://mysite.com/csv/mycolour_myshape.csv')">Load New File</button>
</form>
So the bit i need assistance with is the code required to generate the onClick URL in this format: 'mycolour variable' + '_' + 'myshape variable' + '.csv'
Any ideas?
Pete
July 18,