Results 1 to 5 of 5

Thread: trying to view AND edit txt within in a webpage

  1. #1
    Join Date
    Oct 2006
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default trying to view AND edit txt within in a webpage

    Hi
    I am trying to create a page which will show some small info about a topic when it is clicked on, using a div or iframe, but i would also want to be able to edit and save the info.

    an example would be a list of names, click one of the names and an address would show in a small window (a div or iframe) on the page But I would want to edit the address info either by clicking it to load the .txt file in, say, notepad or to edit it direct on the page itself.

    this is all stored on a local pc and not for web use

    Is this possible at all or am I asking too much

    thanks

  2. #2
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    http://www.quirksmode.org/dom/cms.html

    For saving the edited content permanently you have to use server-side tool even some db

  3. #3
    Join Date
    Oct 2006
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by codeexploiter View Post

    For saving the edited content permanently you have to use server-side tool even some db
    Thanks for the reply, I thought that would be the case.
    I did see that page when I googled around before posting the question, but I kinda hoped there would be a nice simple html & java solution without the db, php, cgi, perl or all the other things I know nothing about.

    Is there any way to open a .txt file in notepad from html/java etc?
    I'm just trying to keep it quick clean and simple

    thanks
    PdS

  4. #4
    Join Date
    Jun 2007
    Posts
    543
    Thanks
    3
    Thanked 78 Times in 78 Posts
    Blog Entries
    1

    Default

    java, yes. javascript, no.
    [Jasme Library (Javascript Motion Effects)] My Site
    /\/\@§†ê® §©®¡þ† /\/\@|{ê®
    There are 10 kinds of people in the world, those that understand binary and those that don't.

  5. #5
    Join Date
    Oct 2006
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I know that java is very different to javascript & jscript.
    I do not really know Java and unfortunately I'm not a competent coder by any means
    Ive been using (or trying to use) this but it just won't work

    Code:
    <script language="jscript" type="text/jscript">
    /***** Original script****
    {
            var objShell = new ActiveXObject("Shell.Application");
            
            objShell.ShellExecute("notepad.exe", "", "", "open", 1);
        }
    */
    
    Function EditEntry(FileName)
    {
    var ProgName = "Notepad.exe";
    var ObjShell = new ActiveXObject("Shell.Application");
    ObjShell.ShellExecute(ProgName, FileName, "", "Open", "1");
    }
    </script>
    </head>
    <body>
    <form>
    <input name="EditButton" type="button" id="EditButton" 
    onclick="EditEntry('test.txt')" 
    value="Edit Entry">
    </form>
    I also found this which actually works but I am struggling to make it work as I want it to (the .txt file is in the same folder as the html file).

    Code:
    <script>
    var ObjShell = new ActiveXObject("WScript.Shell");
    function runNotepad()
    {
    if (window.ActiveXObject) {
    var AppParms = document.getElementById('file').value;
    ObjShell.run ("notepad.exe " + AppParms, "1");
    } else
    alert("You browser doesn\'t support this feature");
    }
    </script>
    </HEAD>
    <BODY>
    <p>
      <input type="text" id="file" value="test.txt">
      <input type="button" value="Run Notepad" onClick="runNotepad()">
    also it is only ie and i would need to work in FireFox.

    This was supposed to be a quick easy way to read info about various machines and edit the info if required without any knowledge AND to be portable eg on a stick from PC to PC hence the idea of using script/ html.

    If this is possible I'd appreciate some help but if its one of those 'looks simple but by god it ain't' scenarios then we'll go back to pen n paper and to hell with technology

    Thanks
    PdS

Bookmarks

Posting Permissions

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