Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •