View Full Version : Writing selection from Drop down menu Created by txt file to a txt file

02-24-2011, 09:34 PM
Hey Guys,
Im so close.. or mayb so far... So iv got a txt file that populates a drop down menu. Once you make your selection the user then clicks submit. Now the output file is created, but im not able to get the users selection to be printed..

<iframe name="myFrame" src="countries.txt" onLoad="showData(this)" height="0" width="0"></iframe>
<form name="poiquery" action="" method=post onsubmit="WriteToFile()">
<select name="mySel">
<p><input type="submit" value="SUBMIT"></p>
function showData(theFrame){
oRow = frames[theFrame.name].document.body.innerHTML.replace(/<[^>]+>/g,"").split("\n");
opt = document.forms[0].mySel.options;
for(var i=0;i<oRow.length;i++){
oVal = oRow[i].split(";");

opt[opt.length] = new Option(oVal[0], oVal[1]);

function WriteToFile()
var fso = new ActiveXObject("Scripting.FileSystemObject");
var s = fso.CreateTextFile("selection.txt", true);


Im sure that its the value in s.Writeline(xxxxx) is just pointing to the wrong place...
Any help will be much appreciated