www.webdeveloper.com
Results 1 to 4 of 4

Thread: Folder Choose scripting errors

  1. #1
    Join Date
    Dec 2006
    Posts
    5

    Folder Choose scripting errors

    We have chml file that we use internally in our company that posts pricing and other text for our staff. We store pictures on our server that are sorted under a main directory by individual folders for each customer we have. When we browse the main directory and there are over 400 folders in it, it takes awhile to scan through them to find the one you want.

    I am trying to create a page that would allow you to type in the name of the folder you want and it would jump to that folder. However, the network path name is quite long, so i would like the default main directory path to be combined with the input of the folder name. I have been searching every where for ideas, but i believe i am running into a security issue, but not sure. I have pasted below what i have been trying so far:


    (i believe that the last "\" listed for patha is causing me an error of an unterminated string constant)

    <HEAD>
    <SCRIPT LANGUAGE="JavaScript">
    function folder()
    {
    var path=prompt('What is the Work Order number?','00');
    var patha="\\Host01\network (D)\WARRANTY PICS\PICS TAKEN 2006\"
    document.frames['mycomputer'].location.src=(patha+path);
    }
    </script>
    </HEAD>
    <BODY>
    <CENTER>
    <input type="button" value="Find Pics" onclick="folder();">
    <iframe name="mycomputer" src="\\Host01\network (D)\WARRANTY PICS\PICS TAKEN 2006\" width="90%" height="80%"></iframe>
    </CENTER>
    </BODY></HTML>

  2. #2
    Join Date
    Oct 2006
    Posts
    1,297
    Quote Originally Posted by sstockford
    (i believe that the last "\" listed for patha is causing me an error of an unterminated string constant)
    Yes, it is. This:

    var patha="\\Host01\network (D)\WARRANTY PICS\PICS TAKEN 2006\"

    would have to be this:

    var patha="\\\\Host01\\network (D)\\WARRANTY PICS\\PICS TAKEN 2006\\"

    Also, this:

    document.frames['mycomputer'].location.src=(patha+path);

    should be this:

    self.frames['mycomputer'].location.href=(patha+path);
    Last edited by so_is_this; 12-20-2006 at 07:08 PM.

  3. #3
    Join Date
    Dec 2006
    Posts
    5

    thank you, thank you, thank you

    I am crying tears of joy.

    thanks

  4. #4
    Join Date
    Oct 2006
    Posts
    1,297
    You're welcome.

    Salud!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles