I am very (very) noob at Web Development and I need help.
To summarize, I collect some data from some HTML forms and make a string out of it in my JavaScript code (global variable _customScript).
<SELECT id="product-green" NAME="Liste" class="select_green" onChange="mviewer.customControls.s2product.updateBandes()">
<OPTION label="B01" value="B01"> B01 </OPTION>
<OPTION label="B02" value="B02"> B02 </OPTION>
<OPTION label="B03" value="B03"> B03 </OPTION>
<OPTION label="B04" value="B04"> B04 </OPTION>
<OPTION label="B05" value="B05"> B05 </OPTION>
<OPTION label="B06" value="B06"> B06 </OPTION>
<OPTION label="B07" value="B07"> B07 </OPTION>
<OPTION label="B08" value="B08"> B08 </OPTION>
<OPTION label="B09" value="B09"> B09 </OPTION>
</SELECT>
updateBandes: function() {
var redBand = $('.select_red').options[$('.select_red').selectedIndex].value;
var greenBand = $('.select_green').options[$('.select_green').selectedIndex].value;
var blueBand = $('.select_blue').options[$('.select_blue').selectedIndex].value;
_customScript = 'return [2.5*'+ redBand + ', 2.5*' + greenBand + ', 2.5*' + blueBand + '];'
_updateEvalScriptFile();
},
Now I need to create a function (_updateEvalScriptFile) in order to put this String inside a file and save it. This file already exists on the server and I have its URL, I just need to clear everthing that is in this file and replace it with this String.
I am pretty sure this is a simple task but I can't find any clear explicit explanation. Can you help me please ? Ps: Sorry if I said something wrong or illogical, as I said I'm pretty noob at web development