Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-24-2011, 09:34 PM   PM User | #1
Francis87
New to the CF scene

 
Join Date: Feb 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Francis87 is an unknown quantity at this point
Writing selection from Drop down menu Created by txt file to a txt file

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..




<html>
<head>
</head>
<body>
<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">
</select>
<p><input type="submit" value="SUBMIT"></p>
<script>
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);
s.WriteLine(window.frames("myFrame").document.getElementID("mySel").value);
s.Close()
}



</script>
</form>
</body>
</html>



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

Last edited by Francis87; 02-24-2011 at 09:40 PM..
Francis87 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:29 PM.


Advertisement
Log in to turn off these ads.