1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Javascript Input Box Locks Up

Discussion in 'Web Design & Development' started by IsolatedSnail, Dec 14, 2011.

Thread Status:
Not open for further replies.
  1. IsolatedSnail

    IsolatedSnail Thread Starter

    Joined:
    Nov 7, 2009
    Messages:
    90
    Hello again TSG,

    I am stuck again and hoping that since Google has failed me the experts here can point me in the right direction. I have created a Windows 7 gadget that takes in a string from a textbox and then calls a VBScript from Windows using WScript.exe so that it uses my Windows permissions to run sendkeys. The sendkeys are necessary to create a loop hole around Cisco Smart Tunnel.

    I use this gadget along with several other IT partners to dial out to our servers/workstations via putty, vnc, or remote desktop depending on the parameters entered in the textbox.

    I know that calling WScript.exe is not ideal and probably not at all recommended from a web development stand point, but it was necessary to run the script with the correct permissions for what we needed. The problem I have now is that after certain events, the text input box will lock up and not allow you to type. I assume this is because it is waiting on WScript.exe or something else to return information. The only time the text box locks up is if the script has already been executed and you cancel out before letting it finish by hitting escape.

    I tried to make an ugly workaround by using an event to copy text from one inputbox to another then call the function from the second text box and it still does the same thing except then both text boxes will be locked up.

    Can anyone provide any insight into this ugly development problem? I know none of my circumstances are ideal and are strongly opposed in normal web development but for the purpose of this gadget in my small business scenario calling the vbscript from wscript.exe is really necessary.

    The first block of code is the main html page for the gadget.
    Code:
    <html xmlns="[URL]http://www.w3.org/1999/xhtml[/URL]">
        <head>
            <!-- Heading information -->
            <meta http-equiv="Content-Type" content="text/html; charset=Unicode" />
            <title>Remote</title>
            <!-- Style definitions -->
            <style type="text/css" language="css">
                body {
                    width:131px; 
                    height:196px; 
                    margin:0px;
                    text-align:center;
                    color:white;
                    font-family:Verdena, sans-serif;
                    background-image:url('images/background.png');
                }
            </style>
            <!-- Loads remote javascript into memory. -->
            <script src="dialer.js" type="text/jscript"></script>
            <!-- Loads message vbscript into memory. -->
            <script src="alert.vbs" type="text/vbscript"></script>
            <!-- Loads control vbscript into memory. -->
            <script src="control.vbs" type="text/vbscript"></script>
        </head>
        <!-- Body of Gadget (html) -->
        <body>
            <table align="center">
                <tr>
                    <img src="images/logo.png" alt="Remote Gadget"/>
                </tr>
                <tr>
                <!-- hostName input box, accepts input from user to start remote connection. -->
                    <input type="text" id="editHost" name="editHost" size="12" onClick="editHost.value='';"
         maxlength="15" value="Enter Host" onKeyUp="sendHost.value=editHost.value;" />
                </tr>
                <tr>
                    <input type="button" name="Ok" value="Ok" onClick="remote(sendHost.value);" />
                    <input type="button" name="Help" value="Help" onClick="printHelp();" />
                    <input type="button" name="abc" value="abc" onClick="reset();" />
                </tr>
                <tr>
                    <font size="3">Use Admin? </font><input id="cbAdmin" type="checkbox"/>
                </tr>
                <tr>
                    <font size="3">Auto Pass? </font><input id="cbPasswd" type="checkbox"/>
                </tr>
       <tr>
        <input type="textarea" id="sendHost" name="sendHost" size="12" 
                        maxlength="15" value ="Redial Box" onClick="remote(sendHost.value);" />
       </tr>
            </table>
        </body>
    </html>
    The second block of code is the javascript where the Wscript.exe is called.
    Code:
    if( !useCachedPassword)
                var execute = myShell.run("Wscript.exe \"C:\\Users\\%USERNAME%\\AppData\\Local\\Microsoft\\Windows Sidebar\\Gadgets\\RemoteBGC.gadget\\sendkeys.vbs\" " + keys);
            else
                var execute2 = myShell.run("Wscript.exe \"C:\\Users\\%USERNAME%\\AppData\\Local\\Microsoft\\Windows Sidebar\\Gadgets\\RemoteBGC.gadget\\buildRdp.vbs\" " + thisHost + " " + admin);
    Thanks for any help or insight into the problem you can provide me.
    -Kyle
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1031239

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice