dropdowns and textboxes

BigCity
BigCity used Ask the Experts™
on
i have a dropdown box that is sending a value to a different web page but i also need it to populate a text box with some numbers.  i would like to know how you would populate a textbox from the dropdown box. so that when the users click on an item in the dropdown list then it would but some numbers in the textbox.

thanks for your help.
Nathan
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
<select onChange="javascript:doFillText()" id=cboOne>
 <OPTION value="X">Option X</OPTION>
</SELECT>

<INPUT type=text id=txtOne>

<SCRIPT language=javascript>
<!--
  function doFillText()
  {
    var idx = document.forms[0].cboOne.selectedIndex;
    document.forms[0].txtOne.text = document.forms[0].cboOne.options[idx].value;
    //or use .text to put the display from cboOne into txtOne
  }
//-->
</SCRIPT>

------------------

if you are going to use a MULTIPLE select box, the we will have to make a slight modification so that the numbers can be appended to the textbox

thomasdodds

Author

Commented:
where do i put the name of the the dropdown box and name of the text box and where do i specify what numbers i want to put in???


and there will be 7 items in the dropdown box and there will be a set of 3 numbers could be places in the text box

Author

Commented:
and the users will only be allowed to select one option int he dropdown and should not be allowed to edit the text box.
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

what is your list for the select box? give them to me in value/"display text" pairs

ie:

xs/Extra Small
sm/Small
md/Medium
lg/Large
xl/Extra Large

and what name do you want to use with the select box and text box?

I can rewrite the scenario to be specific for you...

Author

Commented:
ok here are the options in the dropdown box

LA
Chicago
New York
Orlando
ect...

the values for them are

TimeEntry_LA
TimeEntry_Chicago
TimeEntry_New_York
TimeEntry_Orlando

now the numbers that i need to fill the text box with are

192.12.62.42 (New York, LA)
192.12.62.43 (Orlando)
192.12.62.44 (Chicago)

whats inside those () are the cities that go with those numbers  those will not go into the text box
<select onChange="javascript:doFillText()" id=cboCities name=cboCities>
<OPTION value="TimeEntry_LA">"LA"</OPTION>
<OPTION value="TimeEntry_Chicago">"Chicago"</OPTION>
<OPTION value="TimeEntry_New_York">"New York"</OPTION>
<OPTION value="Orlando">"Orlando"</OPTION>
</SELECT>


gonna send you stuff in pieces so you can see the 'process' ...
<INPUT type=text id=txtIPs name=txtIPs READONLY>

... your text box ...

Author

Commented:
the name of the dropdown box is

name= "UserName"


the name of the text box is

name = "Server"
ID= "editServer"
ok ... you can change what I've sent I will adjust current code ...
<script language="JavaScript">
     function updateIPAddress(inputObj)
          {
          var thisIPAddress = inputObj.options[inputObj.selectedIndex].IPAddress;
          var inputToUpdate = inputObj.form.IPAddress;
          inputToUpdate.value = thisIPAddress;
          }
</script>

<form name="testForm">
     <select name="city" onchange="updateIPAddress(this);">
          <option value=""></option>
          <option value="TimeEntry_LA" IPAddress="192.12.62.42">LA</option>
          <option value="TimeEntry_Chicago" IPAddress="192.12.62.42">Chicago</option>
          <option value="TimeEntry_New_York" IPAddress="192.12.62.43">New York</option>
          <option value="TimeEntry_Orlando" IPAddress="192.12.62.44">Orlando</option>
     </select>
     
     <input type="text" name="IPAddress" disabled="true">
</form>

******************************************************

All you need to do is add the IPAddress attribute to the option, and away you go! I'm assuming that these are IPAddresses. If not, feel free to change the name of the functions. Just be sure that the attribute you add to the options matches attribute in the function up top.

Oh, you'll also need to change the name of the input that you want to fill in with the number within the function at the top.

Let me know if you have any trouble with this code.

-Mike
Or in your case:

<script language="JavaScript">
     function updateServer(inputObj)
          {
          var thisServer = inputObj.options[inputObj.selectedIndex].server;
          var inputToUpdate = inputObj.form.server;
          inputToUpdate.value = thisServer;
          }
</script>

<form name="UserName">
     <select name="city" onchange="updateServer(this);">
          <option value=""></option>
          <option value="TimeEntry_LA" server="192.12.62.42">LA</option>
          <option value="TimeEntry_Chicago" server="192.12.62.42">Chicago</option>
          <option value="TimeEntry_New_York" server="192.12.62.43">New York</option>
          <option value="TimeEntry_Orlando" server="192.12.62.44">Orlando</option>
     </select>
     
     <input type="text" name="server" disabled="true">
</form>
now the javascript function ... put this in the HEAD section of your HTML page ....


<SCRIPT language=javascript>
<!--
 function doFillText()
 {
   //get the currently selected item form the list
   var idx = document.forms[0].UserName.selectedIndex;

   //check against criteria
   //using case - switch statement easier then nested ifs
   switch (document.forms[0].UserName.options[idx].value)
   {
    case 'TimeEntry_LA':
      document.forms[0].editServer.text = '192.12.62.42';
      break;
    case 'TimeEntry_Chicago':
      document.forms[0].editServer.text = '192.12.62.44';
      break;
    case 'TimeEntry_New_York':
      document.forms[0].editServer.text = '192.12.62.42';
      break;
    case 'TimeEntry_Orlando':
      document.forms[0].editServer.text = '192.12.62.43';
      break;
    default:
      //anything else empties the textbox
      document.forms[0].editServer.text = '';
      break;
   }
 }
//-->
</SCRIPT>
diabled text field will not be submitted ....
This is true... I figured the input was just for display purposes, not to send to the processing page. READONLY does make it look a little better anyhow, since it's not grayed out and all.

Make sure that you are not relaying on that IP address on the processing page that this form submits to. Otherwise, people could create a form that would submit whatever IP address they want to your processing page. Also, in older browers, READONLY and DISABLED don't work, and they can change the value at will. What you really want to do is have the processing page determine the IPAddress to connect to based on the city that is returned from the form.

Someone could of course still send whatever city ID they want to via another form, but that's another problem that would be resolved through always ensuring that the referrer was from your site whever you accept a POST.

Author

Commented:
we all use IE 6 so it shouldn't be a problem will it????
pppffft.... no, we're much older for IE. But some Netscape 4 and below version don't accept it.

Author

Commented:
it doesn't like this line

inputToUpdate.value = thisServer;

Author

Commented:
it doesn't like this line

inputToUpdate.value = thisServer;
Using the same script I pasted? Did you modify it at all? Paste your code here. What is the error that you're getting?

Author

Commented:
are TallerMike and Thomasdodds working together or against each other???

Author

Commented:
are TallerMike and Thomasdodds working together or against each other???
I think we're both working the same issue in different ways. I'm just trying to add my direction to the mix. Maybe give some people a few ideas they never thought about.

It's always working together.

Author

Commented:
here is the code for the web page.


<html>
<head>
<title>Remote Desktop Web Connection</title>
<style type="text/css" media="screen">
p { color:"#000000"; font-family: "Verdana, Arial, Helvetica"; font-size:"65%"}
h1 { font-size: 100%; font-family: verdana, arial, helvetica; font-weight: bold;
            margin-top: 0em;}
p.indent { margin-left: 3em; margin-top: .5em; line-height: 1.25em; margin-bottom: .2em; margin-right: 1em;}
.button {
      FONT-FAMILY: Verdana, Helvetica, Arial, San-Serif;
      font-weight:normal;
      font-size:70%;
      color:#000000;
      background-color:#ffffff;
      border-color:#6699ff;
      margin-top:6pt;
      margin-left: .5em;

}
.topspace {margin-top: .08em; }
</style>

<SCRIPT language=javascript>
<!--
function doFillText()
{
//get the currently selected item form the list
var idx = document.forms[0].UserName.selectedIndex;

//check against criteria
//using case - switch statement easier then nested ifs
switch (document.forms[0].UserName.options[idx].value)
{
case 'TimeEntry_Bismarck':
document.forms[0].editServer.text = '192.168.2.216';
break;
case 'TimeEntry_Dickinson':
document.forms[0].editServer.text = '192.168.2.215';
break;
case 'TimeEntry_Helena':
document.forms[0].editServer.text = '192.168.2.217';
break;
case 'TimeEntry_Minot':
document.forms[0].editServer.text = '192.168.2.217';
break;
default:
//anything else empties the textbox
document.forms[0].editServer.text = '';
break;
}
}
//-->
</SCRIPT>



</head>

<body bgcolor="#ffffff">
<script language="vbscript">
<!--
const L_FullScreenWarn1_Text = "Your current security settings do not allow automatically switching to fullscreen mode."
const L_FullScreenWarn2_Text = "You can use ctrl-alt-pause to toggle your remote desktop session to fullscreen mode"
const L_FullScreenTitle_Text = "Remote Desktop Web Connection "
const L_ErrMsg_Text         = "Error connecting to remote computer: "
const L_PlatformCheck_ErrorMessage = "The Remote Desktop Web connection ActiveX control can only run in the 32-bit version of Internet Explorer."

' error messages
const L_DisconnectedCaption_ErrorMessage =  "Remote Desktop Disconnected"
const L_ErrConnectCallFailed_ErrorMessage =  "An error occurred when the client attempted to connect to the remote computer. Check your system memory and then try the connection again."
const L_DisconnectRemoteByServer_ErrorMessage = "The remote computer has ended the connection."
const L_LowMemory_ErrorMessage = "The local computer is low on memory. Close some programs, and then connect to the remote computer again."
const L_SecurityErr_ErrorMessage = "Because of a security error, the client could not connect to the remote computer. Verify that you are logged on to the network, and then try connecting again."
const L_BadServerName_ErrorMessage = "The specified remote computer could not be found. Verify that you have typed the correct computer name or IP address, and then try connecting again."
const L_ConnectFailedProtocol_ErrorMessage = "Because of a protocol error, the client could not connect to the remote computer. Please try connecting to the remote computer again. If the client still fails to connect, contact your network administrator."
const L_CannotLoopBackConnect_ErrorMessage = "The client could not connect. You cannot connect to the console from a console session of the same computer."
const L_NetworkErr_ErrorMessage = "The connection was ended because of a network error. Please try connecting to the remote computer again."
const L_InternalErr_ErrorMessage = "An internal error has occurred."
const L_NotResponding_ErrorMessage = "The client could not connect to the remote computer. Remote connections might not be enabled or the computer might be too busy to accept new connections.It is also possible that network problems are preventing your connection.Please try connecting again later. If the problem continues to occur, contact your administrator."
const L_VersionMismatch_ErrorMessage = "Client and server versions do not match. Please upgrade your client software and then try connecting again."
const L_EncryptionError_ErrorMessage = "Because of an error in data encryption, this session will end. Please try connecting to the remote computer again."
const L_ProtocolErr_ErrorMessage = "Because of a protocol error, this session will be disconnected. Please try connecting to the remote computer again."
const L_IllegalServerName_ErrorMessage = "The specified computer name contains invalid characters. Please verify the name and try again."
const L_ConnectionTimeout_ErrorMessage = "The remote connection has timed out. Please try connecting to the remote computer again."
const L_DisconnectIdleTimeout_ErrorMessage = "The remote session was ended because the idle timeout limit was reached. This limit is set by the server administrator or by network policies."
const L_DisconnectLogonTimeout_ErrorMessage ="The remote session ended because the total logon time limit was reached. This limit is set by the server administrator or by network policies."
const L_ProtocolErrWITHCODE_ErrorMessage  = "Client disconnected due to internal protocol error: "
const L_LicensingTimeout_ErrorMessage = "A licensing error occurred while the client was attempting to connect (Licensing timed out).Please try connecting to the remote computer again."
const L_LicensingNegotFailed_ErrorMessage = "The remote computer disconnected the session because of an error in the licensing protocol.Please try connecting to the remote computer again or contact your server administrator."
const L_DisconnectRemoteByServerTool_ErrorMessage = "The remote session to the remote computer was ended by means of an administration tool.Your administrator might have ended your connection."
const L_LogoffRemoteByServer_ErrorMessage = "The remote session was disconnected because your session was logged off at the remote computer.Your administrator or another user might have ended your connection."
const L_DisconnectByOtherConnection_ErrorMessage = "The remote session was disconnected because another user has connected to the session."
const L_ConnectionBroken_ErrorMessage  = "The connection to the remote computer was broken. This may have been caused by a network error.Please try connecting to the remote computer again."
const L_ServerOutOfMemory_ErrorMessage = "The connection was disconnected because the remote computer is low on memory."
const L_LicenseInternal_ErrorMessage = "The remote session was disconnected because there was an internal error in the remote computer's licensing protocol."
const L_NoLicenseServer_ErrorMessage = "The remote session was disconnected because there are no Terminal Server License Servers available to provide a license.Please contact the server administrator."
const L_NoLicense_ErrorMessage = "The remote session was disconnected because there are no Terminal Server client access licenses available for this computer.Please contact the server administrator."
const L_LicenseBadClientMsg_ErrorMessage = "The remote session was disconnected because the remote computer received an invalid licensing message from this computer."
const L_LicenseHwidDoesntMatch_ErrorMessage = "The remote session was disconnected because the Terminal Server client access license stored on this computer has been modified."
const L_BadClientLicense_ErrorMessage = "The remote session was disconnected because the Terminal Server client access license stored on this computer is in an invalid format."
const L_LicenseCantFinishProtocol_ErrorMessage = "The remote session was disconnected because there were network problems during the licensing protocol.Please try connecting to the remote computer again."
const L_LicenseClientEndedProtocol_ErrorMessage = "The remote session was disconnected because the client prematurely ended the licensing protocol."
const L_LicenseBadClientEncryption_ErrorMessage = "The remote session was disconnected because a licensing message was incorrectly encrypted."
const L_CantUpgradeLicense_ErrorMessage = "The remote session was disconnected because the local computer's client access license could not be upgraded or renewed.Please contact the server administrator."
const L_LicenseNoRemoteConnections_ErrorMessage = "The remote session was disconnected because the remote computer is not licensed to accept remote connections.Please contact the server administrator."
const L_DecompressionFailed_ErrorMessage = "The remote session was disconnected because of a decompression failure at the client side. Please try connecting to the remote computer again."
const L_ServerDeniedConnection_ErrorMessage ="The client could not establish a connection to the remote computer.The most likely causes for this error are:1) Remote connections might not be enabled at the remote computer.2) The maximum number of connections was exceeded at the remote computer.3) A network error occurred while establishing the connection."

sub window_onload()
   if not LCase(Navigator.CpuClass) = "x86" then
      msgbox L_PlatformCheck_ErrorMessage
   end if
   if not autoConnect() then
       Document.all.editServer.Focus
   end if
end sub

function autoConnect()
      Dim sServer
      Dim iFS, iAutoConnect


      sServer = getQS ("Server")
      iAutoConnect = getQS ("AutoConnect")
      iFS = getQS ("FS")

      if NOT IsNumeric ( iFS ) then
            iFS = 0
      else
            iFS = CInt ( iFS )
      end if

      if iAutoConnect <> 1 then
            autoConnect = false
            exit function
      else
            if iFS < 0 or iFS >= Document.all.comboResolution.options.length then
                  iFS = 0
            end if

            if IsNull ( sServer ) or sServer = "" then
                  sServer = window.location.hostname
            end if

            Document.all.comboResolution.selectedIndex      = iFS
            Document.all.Server.value = sServer

            btnConnect ()

            autoConnect = true
      end if

end function

function getQS ( sKey )
      Dim iKeyPos, iDelimPos, iEndPos
      Dim sURL, sRetVal
      iKeyPos = iDelimPos = iEndPos = 0
      sURL = window.location.href

      if sKey = "" Or Len(sKey) < 1 then
            getQS = ""
            exit function
      end if

      iKeyPos = InStr ( 1, sURL, sKey )

      if iKeyPos = 0 then
            sRetVal = ""
            exit function
      end if

      iDelimPos = InStr ( iKeyPos, sURL, "=" )
      iEndPos = InStr ( iDelimPos, sURL, "&" )

      if iEndPos = 0 then
            sRetVal = Mid ( sURL, iDelimPos + 1 )
      else
            sRetVal = Mid ( sURL, iDelimPos + 1, iEndPos - iDelimPos - 1 )
      end if

      getQS = sRetVal
end function

sub OnControlLoad
   set Control = Document.getElementById("MsRdpClient")
   if Not Control is Nothing then
      if Control.readyState = 4 then
         Document.all.connectButton.disabled = FALSE
      end if
   end if
end sub


sub BtnConnect
   Dim serverName
   'server
   if not Document.all.Server.value = "" then
      serverName = Document.all.Server.value
   else
      serverName = Document.location.hostname
   end if
   
   serverName = trim(serverName)
   
   MsRdpClient.server = serverName
   
   'serverName name text
   Document.all.srvNameField.innerHtml = serverName
   
   'Username/Domain
   if Document.all.CheckBoxAutoLogon.checked then
      MsRdpClient.UserName = Document.all.UserName.Value
   end if
   
   'Resolution
   MsRdpClient.FullScreen = FALSE
   select case document.all.comboResolution.value
   case "1"
      MsRdpClient.FullScreen = TRUE
      resWidth  = screen.width
      resHeight = screen.height
   case "2"
      resWidth  = "640"
      resHeight = "480"
   case "3"
      resWidth  = "800"
      resHeight = "600"
   case "4"
      resWidth  = "1024"
      resHeight = "768"
   case "5"
      resWidth  = "1280"
      resHeight = "1024"
   case "6"
      resWidth  = "1600"
      resHeight = "1200"
   end select
   MsRdpClient.DesktopWidth = resWidth
   MsRdpClient.DesktopHeight = resHeight
   
   
   MsRdpClient.Width = resWidth
   MsRdpClient.Height = resHeight
   
   'Device redirection options
   MsRdpClient.AdvancedSettings2.RedirectDrives     = FALSE
   MsRdpClient.AdvancedSettings2.RedirectPrinters   = TRUE
   MsRdpClient.AdvancedSettings2.RedirectPorts      = FALSE
   MsRdpClient.AdvancedSettings2.RedirectSmartCards = FALSE
   
   'FullScreen title
   MsRdpClient.FullScreenTitle = L_FullScreenTitle_Text & "(" & serverName & ")"
   
   'Display connect region
   Document.all.loginArea.style.display = "none"
   Document.all.connectArea.style.display = "block"
   
   'Connect
   MsRdpClient.Connect
end sub

-->

</script>

<!--  
-->

<!-- =========================LOGIN AREA   ==========================
-->
<div id=loginArea>
<font size="4">
<img border="0" src="win2000l.gif" id=leftalign align="left" width="124" height="123" hspace="10"></font></font><font id=Tahoma1 face="Tahoma" size="1"><br>
</font><font size="6" id=Tahoma2 face="Tahoma">
<img border="0" src="win2000r.gif" hspace="0" vspace="7" width="145" height="45"></font><font id=Tahoma3 face="Tahoma" size="4"><br>
</font><b>
<font id=Tahoma4 face="Tahoma" size="4"><ID id=bigtitle>Remote Desktop Web Connection </ID></font></b><p>&nbsp;</p>

<table border="0" width="640" cellspacing="0" cellpadding=0 style="margin-top: -1em;">
<!-- Graphic bar row  -->
<tr>
<td width="50%"></td>
<td colspan=3 align="left" valign="middle">
<img src="bluebarh.gif" alt="blue bar graphic" width="325" height="8"></td>
</tr>
<!-- Row 1 -->
    <tr>
<!-- Column 1 spans 4 rows -->
    <td valign="top" width="50% "rowspan=4>
          <p class=indent><ID id=remotecomputername>Type the name of the remote computer you want to use, select the screen size for your connection, and then click <b>Connect</b>.</ID></p>
          <p class=indent><ID id=helpfultip1>When the connection page opens, you can add it to your Favorites for easy connection to the same computer.</ID></p>
    </td>
<!-- Column 2 spans 4 rows-->
      <td rowspan=4 valign="top" align="left">
    <img src="bluebarv.gif" alt="blue bar graphic" border=0 width="8" height="330">
      </td>
      
<!-- Column 3 -->            
    <td id="ServerNameKeyWidth" style="width:10%;" valign="middle">    
         <label id=ServerNameKey accessKey="S" for="editServer">
         <br><p align="right">&nbsp;<ID id=ServerName><u>S</u>erver:</ID></label></p>
         </td>
             
<!-- Column 4 -->              
      <td id="ServerKeyWidth" width="40%" valign="bottom">
      <br>&nbsp;&nbsp;<input type="text" name="Server" size="41" id="editServer" >
      
      
      
      </td>
      </tr>
<!-- Row 2 -->
<tr>
<!-- Column 3 -->
<td valign="middle">
<p align="right"><label id=sizeKey accessKey="Z" for="comboRes" class="sizespace"><ID id=size>Si<u>z</u>e:</ID></p></td>
<!-- Column 4 -->
<td valign="bottom">&nbsp;&nbsp;<select size="1" name="comboResolution" id=comboRes class="topspace">
              <option selected value="1"><ID id=option1>Full-screen</ID></option>
              <option value="2"><ID id=option2>640 by 480</ID></option>
              <option value="3"><ID id=option3>800 by 600</ID></option>
              <option value="4"><ID id=option4>1024 by 768</ID></option>
              <option value="5"><ID id=option5>1280 by 1024</ID></option>
              <option value="6"><ID id=option6>1600 by 1200</ID></option>
            </select> </label>
</td>
</tr>
<!-- Row 3 -->
<tr>
<!-- Column 3 -->
<td></td>
<!-- Column 4 -->
<td align="bottom">                  
       <p class=topspace>&nbsp;<input type="checkbox" name="CheckBoxAutoLogon" ID=Check1 value="OFF" onclick = "checkClick" checked><label for="Check1" ID=SendLogonKey accesskey="l"><ID id=logoninfo>Send <u>l</u>ogon information for this connection&nbsp;</ID></label><br>
        
<span ID="tableLogonInfo">

            <p align="left" class=topspace>
                  <br>
                  
           
            Office&nbsp;
                  
           
<select onChange="javascript:doFillText()" id=usernamelabel name=UserName>
<OPTION value="TimeEntry_Bismarck">Bismarck</OPTION>
<OPTION value="TimeEntry_Dickinson">Dickinson</OPTION>
<OPTION value="TimeEntry_Helena">Helena</OPTION>
<OPTION value="TimeEntry_Minot">Minot</OPTION>
</SELECT>
           
           

</span>      
          &nbsp;</td>
</tr>
<!-- Row 4 -->
<tr>
<!-- Column 3 -->
<td  height="215">&nbsp;</td>
<!-- Column 4 -->
<td>      
          <input type="submit" id=connectbutton value="Connect" disabled="TRUE" name="ButtonLogin" OnClick=BtnConnect class="button"></td>
</tr>

 
     
</table>
</div>
<!-- ================================= LOGIN FORM =================
-->

<!-- ================================= CONNECT ====================
-->
<div id=connectArea style="display: none">
<center>
        <table>
        <tr>
        <OBJECT language="vbscript" ID="MsRdpClient"
        onreadystatechange="OnControlLoad"
        CLASSID="CLSID:9059f30f-4eb1-4bd2-9fdc-36f43a218f4a"
        CODEBASE="msrdp.cab#version=5,1,2600,1095"
        WIDTH=<% resWidth = Request.QueryString("rW")
            if  resWidth < 200 or resWidth > 1600 then
               resWidth = 800
            end if
            Response.Write resWidth %>
        HEIGHT=<% resHeight = Request.QueryString("rH")
            if  resHeight < 200 or resHeight > 1200 then
               resHeight = 600
            end if
            Response.Write resHeight %>>
        </OBJECT>
        </tr>
        <tr>
        <br>
        <font size="1" color="#000000" id="srvfontname" face="Verdana, Arial, Helvetica">
        <div id=connectDisplay style="display:none">
        <ID id=loggedinsrv>Connected to </ID><i><span id="srvNameField"></span></i></font><br></div>
        </tr>
       
<script language="VBScript">
<!--
sub ReturnToConnectPage()
   Window.Navigate("Default.htm")
end sub

sub MsRdpClient_OnConnected()
   Document.All.connectDisplay.style.display = "block"
end sub

sub MsRdpClient_OnDisconnected(disconnectCode)
   extendedDiscReason = MsRdpClient.ExtendedDisconnectReason
   majorDiscReason = disconnectCode And &hFF

   if (disconnectCode = &hB08 or majorDiscReason = 2 or majorDiscReason = 1) and not (extendedDiscReason = 5) then
      'Switch back to login area
      ReturnToConnectPage
      exit sub
   end if
   
   errMsgText = L_DisconnectRemoteByServer_ErrorMessage
   if not extendedDiscReason = 0 then
      'Use the extended disconnect code
      select case extendedDiscReason
      case 0   errMsgText  = ""
      case 1   errMsgText  = L_DisconnectRemoteByServerTool_ErrorMessage
      case 2   errMsgText  = L_LogoffRemoteByServer_ErrorMessage
      case 3   errMsgText  = L_DisconnectIdleTimeout_ErrorMessage
      case 4   errMsgText  = L_DisconnectLogonTimeout_ErrorMessage
      case 5   errMsgText  = L_DisconnectByOtherConnection_ErrorMessage
      case 6   errMsgText  = L_ServerOutOfMemory_ErrorMessage
      case 7   errMsgText  = L_ServerDeniedConnection_ErrorMessage
      case 256 errMsgText  = L_LicenseInternal_ErrorMessage
      case 257 errMsgText  = L_NoLicenseServer_ErrorMessage
      case 258 errMsgText  = L_NoLicense_ErrorMessage
      case 259 errMsgText  = L_LicenseBadClientMsg_ErrorMessage
      case 260 errMsgText  = L_LicenseHwidDoesntMatch_ErrorMessage
      case 261 errMsgText  = L_BadClientLicense_ErrorMessage
      case 262 errMsgText  = L_LicenseCantFinishProtocol_ErrorMessage
      case 263 errMsgText  = L_LicenseClientEndedProtocol_ErrorMessage
      case 264 errMsgText  = L_LicenseBadClientEncryption_ErrorMessage
      case 265 errMsgText  = L_CantUpgradeLicense_ErrorMessage
      case 266 errMsgText  = L_LicenseNoRemoteConnections_ErrorMessage
      case else errMsgText = L_ErrMsg_Text
      end select
      if extendedDiscReason > 4096 then
         errMsgText = L_ProtocolErrWITHCODE_ErrorMessage  & errMsgText
      end if
   else
      ' no extended error information, use the disconnect code
      select case disconnectCode
      case 0   errMsgText  = L_ErrMsg_Text
      case 1   errMsgText  = L_ErrMsg_Text
      case 2   errMsgText  = L_ErrMsg_Text
      case 260 errMsgText  = L_BadServerName_ErrorMessage
      case 262 errMsgText  = L_LowMemory_ErrorMessage
      case 264 errMsgText  = L_ConnectionTimeout_ErrorMessage
      case 516 errMsgText  = L_NotResponding_ErrorMessage
      case 518 errMsgText  = L_LowMemory_ErrorMessage
      case 520 errMsgText  = L_BadServerName_ErrorMessage
      case 772 errMsgText  = L_NetworkErr_ErrorMessage
      case 774 errMsgText  = L_LowMemory_ErrorMessage
      case 776 errMsgText  = L_BadServerName_ErrorMessage
      case 1028 errMsgText = L_NetworkErr_ErrorMessage
      case 1030 errMsgText = L_SecurityErr_ErrorMessage
      case 1032 errMsgText = L_IllegalServerName_ErrorMessage
      case 1286 errMsgText = L_EncryptionError_ErrorMessage
      case 1288 errMsgText = L_BadServerName_ErrorMessage
      case 1540 errMsgText = L_BadServerName_ErrorMessage
      case 1542 errMsgText = L_SecurityErr_ErrorMessage
      case 1544 errMsgText = L_LowMemory_ErrorMessage
      case 1796 errMsgText = L_NotResponding_ErrorMessage
      case 1798 errMsgText = L_SecurityErr_ErrorMessage
      case 1800 errMsgText = L_CannotLoopBackConnect_ErrorMessage
      case 2052 errMsgText = L_BadServerName_ErrorMessage
      case 2056 errMsgText = L_LicensingNegotFailed_ErrorMessage
      case 2310 errMsgText = L_SecurityErr_ErrorMessage
      case 2566 errMsgText = L_SecurityErr_ErrorMessage
      case 2822 errMsgText = L_EncryptionError_ErrorMessage
      case 3078 errMsgText = L_EncryptionError_ErrorMessage
      case 3080 errMsgText = L_DecompressionFailed_ErrorMessage
      case 3334 errMsgText = L_ProtocolErr_ErrorMessage
      case 10500 errMsgText = L_ProtocolErr_ErrorMessage
      case else errMsgText = L_InternalErr_ErrorMessage
      end select
   end if
   
   msgbox errMsgText,0,L_DisconnectedCaption_ErrorMessage
   ReturnToConnectPage
   
end sub
-->
        </script>
</table>
</center>
</div>


</body>
</html>

Author

Commented:
the errors i get are

Line 28
Char 1
Error: Document.formas.0.UserName' is null or not an object
Code: 0


Line  364
Char 1
Error Object doesn't support this property or method
Code: 0
I think the error you were having with the "inputToUpdate.value = thisServer;" line was due to a mistake in my select. I'm assuming what you did was to select the first option at some point, and it does not have a server attribute. So change the first option from:

<option value=""></option>

to this:

<option value="" server=""></option>
I don't see any form tags in your code? Did I miss them or are they not there? You'll need to have those around your select and input tags.

The line numbers for the errors are for the HTML that is generated, not the ASP code, so I'm having a hard time figuring where the second error is coming from. Try viewing the source of the HTML that is created, and see if you can paste the line where the second error is occuring.

Author

Commented:
<input type="submit" id=connectbutton value="Connect" disabled="TRUE" name="ButtonLogin" OnClick=BtnConnect class="button">

Author

Commented:
i am also using Frontpage 2000 if that has any effect on things i don't know

Author

Commented:
i am also using Frontpage 2000 if that has any effect on things i don't know
<input type="submit" id=connectbutton value="Connect" disabled="TRUE" name="ButtonLogin" OnClick=BtnConnect class="button">

doesn't seem right; should it be?

<input type="submit" id="connectbutton" value="Connect" DISABLED name="ButtonLogin" OnClick="BtnConnect()" class="button">

could be splitting hairs ... dunno

Author

Commented:
i am also using Frontpage 2000 if that has any effect on things i don't know

Author

Commented:
should i be able to see what is being put into the textbox when an option in the dropdown is clicked??

because i can't see it.

Author

Commented:
where do i need to put the form tags???
it has a tendancy to write/rewrite code doesn't it ... I use MS VI & EditPlus2 on occasion ... can't really speak to FP

without form tags the code I supplied will not work; you will have to take out the forms[0]. references, ie:

document.forms[0].control.value = "blah";
would then be
document.control.value = "blah";

but since I can't recall ever not using a form, there may be other alterations you may have to make ...
Without a form tag on your page, you will not see anything. Both the code that thomas and I have placed here require that there is a form tag on the page. First add a form tag around your inputs, and then try either code again.
looking at your code now ...

Author

Commented:
yes
change the javascript block to:

<SCRIPT language=javascript>
<!--
function doFillText()
{
//get the currently selected item form the list
var idx = document.forms[0].UserName.selectedIndex;

//check against criteria
//using case - switch statement easier then nested ifs
switch (document.forms[0].UserName.options[idx].value)
{
case 'TimeEntry_Bismarck':
document.forms[0].Server.text = '192.168.2.216';
break;
case 'TimeEntry_Dickinson':
document.forms[0].Server.text = '192.168.2.215';
break;
case 'TimeEntry_Helena':
document.forms[0].Server.text = '192.168.2.217';
break;
case 'TimeEntry_Minot':
document.forms[0].Server.text = '192.168.2.217';
break;
default:
//anything else empties the textbox
document.forms[0].Server.text = '';
break;
}
}
//-->
</SCRIPT>

Author

Commented:
yes
and put a form tag just above the username select and close it just after the server textbox ...
sorry, change the javascript block to:

<SCRIPT language=javascript>
<!--
function doFillText()
{
//get the currently selected item form the list
var idx = document.forms[0].UserName.selectedIndex;

//check against criteria
//using case - switch statement easier then nested ifs
switch (document.forms[0].UserName.options[idx].value)
{
case 'TimeEntry_Bismarck':
document.forms[0].Server.value= '192.168.2.216';
break;
case 'TimeEntry_Dickinson':
document.forms[0].Server.value= '192.168.2.215';
break;
case 'TimeEntry_Helena':
document.forms[0].Server.value= '192.168.2.217';
break;
case 'TimeEntry_Minot':
document.forms[0].Server.value= '192.168.2.217';
break;
default:
//anything else empties the textbox
document.forms[0].Server.value= '';
break;
}
}
//-->
</SCRIPT>
was using .text -- need .value (too much .NET!!!!)

Author

Commented:
yes

Author

Commented:
yes
As long as you put them OUTSIDE of all of your inputs, it doesn't matter where you put them really. Try putting the start form tag before your table declaration, and the end tag after the end table declaration like this:

<form>
<table...

... all your other code here...

</table>
</form>

Author

Commented:
When i put those form tags in then it comes back with an error in

Line 210
Char 4
Error Object required 'MsRdpClient'
Code 0

and the line of code that it is referring to-

MsRdpClient.server = serverName

Author

Commented:
sorry when i still can't see the ip address in the textbox, when i choose one of the options from the dropdown boxes...

Author

Commented:
does either of you have MSN Messenger??

Author

Commented:
does either of you have MSN Messenger??
thomasdodds@hotmail.com MSN messanger

Commented:
Since you are using VBScript, why not try the following VBScript in replacement of the Javascript provided by Thomas and TallerMike. What they are saying so far should work correctly, but when you enclose your inputs with a FORM tag, it will disrupt your VBScript code that do the server connection.

Sub doFillText
  Select Case Document.all.UserName.value
  Case "TimeEntry_Bismarck":
    Document.all.editServer.value = "192.168.2.216"
  Case "TimeEntry_Dickinson":
    Document.all.editServer.value = "192.168.2.215"
  Case "TimeEntry_Helena":
    Document.all.editServer.value = "192.168.2.217"
  Case "TimeEntry_Minot":
    Document.all.editServer.value = "192.168.2.217"
  Case Else
    Document.all.editServer.value = ""
  End Select
End Sub

-----------------------------------------------

Where to place this? Place is in your VBScript <SCRIPT> section alongside with other VBScript functions.

Also, change your combo box <SELECT> element to the following:

<select onChange="VBScript:doFillText" id=usernamelabel name=UserName>
<OPTION value="TimeEntry_Bismarck">Bismarck</OPTION>
<OPTION value="TimeEntry_Dickinson">Dickinson</OPTION>
<OPTION value="TimeEntry_Helena">Helena</OPTION>
<OPTION value="TimeEntry_Minot">Minot</OPTION>
</SELECT>

And don't forget to put your "editServer" input box as "READONLY" like the following:

<input type="text" name="Server" size="41" id="editServer" READONLY>


This way, since you're using IE6, you don't have to worry about the form anymore....

Here's your revised code:
--------------------------------------------------------

<html>
<head>
<title>Remote Desktop Web Connection</title>
<style type="text/css" media="screen">
p { color:"#000000"; font-family: "Verdana, Arial, Helvetica"; font-size:"65%"}
h1 { font-size: 100%; font-family: verdana, arial, helvetica; font-weight: bold;
          margin-top: 0em;}
p.indent { margin-left: 3em; margin-top: .5em; line-height: 1.25em; margin-bottom: .2em; margin-right: 1em;}
.button {
     FONT-FAMILY: Verdana, Helvetica, Arial, San-Serif;
     font-weight:normal;
     font-size:70%;
     color:#000000;
     background-color:#ffffff;
     border-color:#6699ff;
     margin-top:6pt;
     margin-left: .5em;

}
.topspace {margin-top: .08em; }
</style>

</head>

<body bgcolor="#ffffff">
<script language="vbscript">
<!--
const L_FullScreenWarn1_Text = "Your current security settings do not allow automatically switching to fullscreen mode."
const L_FullScreenWarn2_Text = "You can use ctrl-alt-pause to toggle your remote desktop session to fullscreen mode"
const L_FullScreenTitle_Text = "Remote Desktop Web Connection "
const L_ErrMsg_Text         = "Error connecting to remote computer: "
const L_PlatformCheck_ErrorMessage = "The Remote Desktop Web connection ActiveX control can only run in the 32-bit version of Internet Explorer."

' error messages
const L_DisconnectedCaption_ErrorMessage =  "Remote Desktop Disconnected"
const L_ErrConnectCallFailed_ErrorMessage =  "An error occurred when the client attempted to connect to the remote computer. Check your system memory and then try the connection again."
const L_DisconnectRemoteByServer_ErrorMessage = "The remote computer has ended the connection."
const L_LowMemory_ErrorMessage = "The local computer is low on memory. Close some programs, and then connect to the remote computer again."
const L_SecurityErr_ErrorMessage = "Because of a security error, the client could not connect to the remote computer. Verify that you are logged on to the network, and then try connecting again."
const L_BadServerName_ErrorMessage = "The specified remote computer could not be found. Verify that you have typed the correct computer name or IP address, and then try connecting again."
const L_ConnectFailedProtocol_ErrorMessage = "Because of a protocol error, the client could not connect to the remote computer. Please try connecting to the remote computer again. If the client still fails to connect, contact your network administrator."
const L_CannotLoopBackConnect_ErrorMessage = "The client could not connect. You cannot connect to the console from a console session of the same computer."
const L_NetworkErr_ErrorMessage = "The connection was ended because of a network error. Please try connecting to the remote computer again."
const L_InternalErr_ErrorMessage = "An internal error has occurred."
const L_NotResponding_ErrorMessage = "The client could not connect to the remote computer. Remote connections might not be enabled or the computer might be too busy to accept new connections.It is also possible that network problems are preventing your connection.Please try connecting again later. If the problem continues to occur, contact your administrator."
const L_VersionMismatch_ErrorMessage = "Client and server versions do not match. Please upgrade your client software and then try connecting again."
const L_EncryptionError_ErrorMessage = "Because of an error in data encryption, this session will end. Please try connecting to the remote computer again."
const L_ProtocolErr_ErrorMessage = "Because of a protocol error, this session will be disconnected. Please try connecting to the remote computer again."
const L_IllegalServerName_ErrorMessage = "The specified computer name contains invalid characters. Please verify the name and try again."
const L_ConnectionTimeout_ErrorMessage = "The remote connection has timed out. Please try connecting to the remote computer again."
const L_DisconnectIdleTimeout_ErrorMessage = "The remote session was ended because the idle timeout limit was reached. This limit is set by the server administrator or by network policies."
const L_DisconnectLogonTimeout_ErrorMessage ="The remote session ended because the total logon time limit was reached. This limit is set by the server administrator or by network policies."
const L_ProtocolErrWITHCODE_ErrorMessage  = "Client disconnected due to internal protocol error: "
const L_LicensingTimeout_ErrorMessage = "A licensing error occurred while the client was attempting to connect (Licensing timed out).Please try connecting to the remote computer again."
const L_LicensingNegotFailed_ErrorMessage = "The remote computer disconnected the session because of an error in the licensing protocol.Please try connecting to the remote computer again or contact your server administrator."
const L_DisconnectRemoteByServerTool_ErrorMessage = "The remote session to the remote computer was ended by means of an administration tool.Your administrator might have ended your connection."
const L_LogoffRemoteByServer_ErrorMessage = "The remote session was disconnected because your session was logged off at the remote computer.Your administrator or another user might have ended your connection."
const L_DisconnectByOtherConnection_ErrorMessage = "The remote session was disconnected because another user has connected to the session."
const L_ConnectionBroken_ErrorMessage  = "The connection to the remote computer was broken. This may have been caused by a network error.Please try connecting to the remote computer again."
const L_ServerOutOfMemory_ErrorMessage = "The connection was disconnected because the remote computer is low on memory."
const L_LicenseInternal_ErrorMessage = "The remote session was disconnected because there was an internal error in the remote computer's licensing protocol."
const L_NoLicenseServer_ErrorMessage = "The remote session was disconnected because there are no Terminal Server License Servers available to provide a license.Please contact the server administrator."
const L_NoLicense_ErrorMessage = "The remote session was disconnected because there are no Terminal Server client access licenses available for this computer.Please contact the server administrator."
const L_LicenseBadClientMsg_ErrorMessage = "The remote session was disconnected because the remote computer received an invalid licensing message from this computer."
const L_LicenseHwidDoesntMatch_ErrorMessage = "The remote session was disconnected because the Terminal Server client access license stored on this computer has been modified."
const L_BadClientLicense_ErrorMessage = "The remote session was disconnected because the Terminal Server client access license stored on this computer is in an invalid format."
const L_LicenseCantFinishProtocol_ErrorMessage = "The remote session was disconnected because there were network problems during the licensing protocol.Please try connecting to the remote computer again."
const L_LicenseClientEndedProtocol_ErrorMessage = "The remote session was disconnected because the client prematurely ended the licensing protocol."
const L_LicenseBadClientEncryption_ErrorMessage = "The remote session was disconnected because a licensing message was incorrectly encrypted."
const L_CantUpgradeLicense_ErrorMessage = "The remote session was disconnected because the local computer's client access license could not be upgraded or renewed.Please contact the server administrator."
const L_LicenseNoRemoteConnections_ErrorMessage = "The remote session was disconnected because the remote computer is not licensed to accept remote connections.Please contact the server administrator."
const L_DecompressionFailed_ErrorMessage = "The remote session was disconnected because of a decompression failure at the client side. Please try connecting to the remote computer again."
const L_ServerDeniedConnection_ErrorMessage ="The client could not establish a connection to the remote computer.The most likely causes for this error are:1) Remote connections might not be enabled at the remote computer.2) The maximum number of connections was exceeded at the remote computer.3) A network error occurred while establishing the connection."

sub window_onload()
  if not LCase(Navigator.CpuClass) = "x86" then
     msgbox L_PlatformCheck_ErrorMessage
  end if
  if not autoConnect() then
      Document.all.editServer.Focus
  end if
end sub

function autoConnect()
     Dim sServer
     Dim iFS, iAutoConnect


     sServer = getQS ("Server")
     iAutoConnect = getQS ("AutoConnect")
     iFS = getQS ("FS")

     if NOT IsNumeric ( iFS ) then
          iFS = 0
     else
          iFS = CInt ( iFS )
     end if

     if iAutoConnect <> 1 then
          autoConnect = false
          exit function
     else
          if iFS < 0 or iFS >= Document.all.comboResolution.options.length then
               iFS = 0
          end if

          if IsNull ( sServer ) or sServer = "" then
               sServer = window.location.hostname
          end if

          Document.all.comboResolution.selectedIndex     = iFS
          Document.all.Server.value = sServer

          btnConnect ()

          autoConnect = true
     end if

end function

function getQS ( sKey )
     Dim iKeyPos, iDelimPos, iEndPos
     Dim sURL, sRetVal
     iKeyPos = iDelimPos = iEndPos = 0
     sURL = window.location.href

     if sKey = "" Or Len(sKey) < 1 then
          getQS = ""
          exit function
     end if

     iKeyPos = InStr ( 1, sURL, sKey )

     if iKeyPos = 0 then
          sRetVal = ""
          exit function
     end if

     iDelimPos = InStr ( iKeyPos, sURL, "=" )
     iEndPos = InStr ( iDelimPos, sURL, "&" )

     if iEndPos = 0 then
          sRetVal = Mid ( sURL, iDelimPos + 1 )
     else
          sRetVal = Mid ( sURL, iDelimPos + 1, iEndPos - iDelimPos - 1 )
     end if

     getQS = sRetVal
end function

sub OnControlLoad
  set Control = Document.getElementById("MsRdpClient")
  if Not Control is Nothing then
     if Control.readyState = 4 then
        Document.all.connectButton.disabled = FALSE
     end if
  end if
end sub


sub BtnConnect
  Dim serverName
  'server
  if not Document.all.Server.value = "" then
     serverName = Document.all.Server.value
  else
     serverName = Document.location.hostname
  end if
 
  serverName = trim(serverName)
 
  MsRdpClient.server = serverName
 
  'serverName name text
  Document.all.srvNameField.innerHtml = serverName
 
  'Username/Domain
  if Document.all.CheckBoxAutoLogon.checked then
     MsRdpClient.UserName = Document.all.UserName.Value
  end if
 
  'Resolution
  MsRdpClient.FullScreen = FALSE
  select case document.all.comboResolution.value
  case "1"
     MsRdpClient.FullScreen = TRUE
     resWidth  = screen.width
     resHeight = screen.height
  case "2"
     resWidth  = "640"
     resHeight = "480"
  case "3"
     resWidth  = "800"
     resHeight = "600"
  case "4"
     resWidth  = "1024"
     resHeight = "768"
  case "5"
     resWidth  = "1280"
     resHeight = "1024"
  case "6"
     resWidth  = "1600"
     resHeight = "1200"
  end select
  MsRdpClient.DesktopWidth = resWidth
  MsRdpClient.DesktopHeight = resHeight
 
 
  MsRdpClient.Width = resWidth
  MsRdpClient.Height = resHeight
 
  'Device redirection options
  MsRdpClient.AdvancedSettings2.RedirectDrives     = FALSE
  MsRdpClient.AdvancedSettings2.RedirectPrinters   = TRUE
  MsRdpClient.AdvancedSettings2.RedirectPorts      = FALSE
  MsRdpClient.AdvancedSettings2.RedirectSmartCards = FALSE
 
  'FullScreen title
  MsRdpClient.FullScreenTitle = L_FullScreenTitle_Text & "(" & serverName & ")"
 
  'Display connect region
  Document.all.loginArea.style.display = "none"
  Document.all.connectArea.style.display = "block"
 
  'Connect
  MsRdpClient.Connect
end sub

sub doFillText
      Select Case Document.all.UserName.value
            case "TimeEntry_Bismarck":
                  Document.all.editServer.value = "192.168.2.216"
            case "TimeEntry_Dickinson":
                  Document.all.editServer.value = "192.168.2.215"
                  case "TimeEntry_Helena":
                  Document.all.editServer.value = "192.168.2.217"
            case "TimeEntry_Minot":
                  Document.all.editServer.value= "192.168.2.217"
            case else
                  Document.all.editServer.value = ""
      End Select
End Sub

-->

</script>

<!--  
-->

<!-- =========================LOGIN AREA   ==========================
-->
<div id=loginArea>
<font size="4">
<img border="0" src="win2000l.gif" id=leftalign align="left" width="124" height="123" hspace="10"></font></font><font id=Tahoma1 face="Tahoma" size="1"><br>
</font><font size="6" id=Tahoma2 face="Tahoma">
<img border="0" src="win2000r.gif" hspace="0" vspace="7" width="145" height="45"></font><font id=Tahoma3 face="Tahoma" size="4"><br>
</font><b>
<font id=Tahoma4 face="Tahoma" size="4"><ID id=bigtitle>Remote Desktop Web Connection </ID></font></b><p>&nbsp;</p>

<table border="0" width="640" cellspacing="0" cellpadding=0 style="margin-top: -1em;">
<!-- Graphic bar row  -->
<tr>
<td width="50%"></td>
<td colspan=3 align="left" valign="middle">
<img src="bluebarh.gif" alt="blue bar graphic" width="325" height="8"></td>
</tr>
<!-- Row 1 -->
   <tr>
<!-- Column 1 spans 4 rows -->
   <td valign="top" width="50% "rowspan=4>
         <p class=indent><ID id=remotecomputername>Type the name of the remote computer you want to use, select the screen size for your connection, and then click <b>Connect</b>.</ID></p>
         <p class=indent><ID id=helpfultip1>When the connection page opens, you can add it to your Favorites for easy connection to the same computer.</ID></p>
   </td>
<!-- Column 2 spans 4 rows-->
     <td rowspan=4 valign="top" align="left">
   <img src="bluebarv.gif" alt="blue bar graphic" border=0 width="8" height="330">
     </td>
     
<!-- Column 3 -->          
   <td id="ServerNameKeyWidth" style="width:10%;" valign="middle">    
        <label id=ServerNameKey accessKey="S" for="editServer">
        <br><p align="right">&nbsp;<ID id=ServerName><u>S</u>erver:</ID></label></p>
        </td>
           
<!-- Column 4 -->            
     <td id="ServerKeyWidth" width="40%" valign="bottom">
     <br>&nbsp;&nbsp;<input type="text" name="Server" size="41" id="editServer" READONLY>
     
     
     
     </td>
     </tr>
<!-- Row 2 -->
<tr>
<!-- Column 3 -->
<td valign="middle">
<p align="right"><label id=sizeKey accessKey="Z" for="comboRes" class="sizespace"><ID id=size>Si<u>z</u>e:</ID></p></td>
<!-- Column 4 -->
<td valign="bottom">&nbsp;&nbsp;<select size="1" name="comboResolution" id=comboRes class="topspace">
             <option selected value="1"><ID id=option1>Full-screen</ID></option>
             <option value="2"><ID id=option2>640 by 480</ID></option>
             <option value="3"><ID id=option3>800 by 600</ID></option>
             <option value="4"><ID id=option4>1024 by 768</ID></option>
             <option value="5"><ID id=option5>1280 by 1024</ID></option>
             <option value="6"><ID id=option6>1600 by 1200</ID></option>
           </select> </label>
</td>
</tr>
<!-- Row 3 -->
<tr>
<!-- Column 3 -->
<td></td>
<!-- Column 4 -->
<td align="bottom">              
      <p class=topspace>&nbsp;<input type="checkbox" name="CheckBoxAutoLogon" ID=Check1 value="OFF" onclick = "checkClick" checked><label for="Check1" ID=SendLogonKey accesskey="l"><ID id=logoninfo>Send <u>l</u>ogon information for this connection&nbsp;</ID></label><br>
       
<span ID="tableLogonInfo">

           <p align="left" class=topspace>
               <br>
               
           
           Office&nbsp;
               
           
<select onChange="VBScript:doFillText" id=usernamelabel name=UserName>
<OPTION value="TimeEntry_Bismarck">Bismarck</OPTION>
<OPTION value="TimeEntry_Dickinson">Dickinson</OPTION>
<OPTION value="TimeEntry_Helena">Helena</OPTION>
<OPTION value="TimeEntry_Minot">Minot</OPTION>
</SELECT>
           
           

</span>    
         &nbsp;</td>
</tr>
<!-- Row 4 -->
<tr>
<!-- Column 3 -->
<td  height="215">&nbsp;</td>
<!-- Column 4 -->
<td>    
         <input type="submit" id=connectbutton value="Connect" disabled="TRUE" name="ButtonLogin" OnClick=BtnConnect class="button"></td>
</tr>


   
</table>
</div>
<!-- ================================= LOGIN FORM =================
-->

<!-- ================================= CONNECT ====================
-->
<div id=connectArea style="display: none">
<center>
       <table>
       <tr>
       <OBJECT language="vbscript" ID="MsRdpClient"
       onreadystatechange="OnControlLoad"
       CLASSID="CLSID:9059f30f-4eb1-4bd2-9fdc-36f43a218f4a"
       CODEBASE="msrdp.cab#version=5,1,2600,1095"
       WIDTH=<% resWidth = Request.QueryString("rW")
           if  resWidth < 200 or resWidth > 1600 then
              resWidth = 800
           end if
           Response.Write resWidth %>
       HEIGHT=<% resHeight = Request.QueryString("rH")
           if  resHeight < 200 or resHeight > 1200 then
              resHeight = 600
           end if
           Response.Write resHeight %>>
       </OBJECT>
       </tr>
       <tr>
       <br>
       <font size="1" color="#000000" id="srvfontname" face="Verdana, Arial, Helvetica">
       <div id=connectDisplay style="display:none">
       <ID id=loggedinsrv>Connected to </ID><i><span id="srvNameField"></span></i></font><br></div>
       </tr>
       
<script language="VBScript">
<!--
sub ReturnToConnectPage()
  Window.Navigate("Default.htm")
end sub

sub MsRdpClient_OnConnected()
  Document.All.connectDisplay.style.display = "block"
end sub

sub MsRdpClient_OnDisconnected(disconnectCode)
  extendedDiscReason = MsRdpClient.ExtendedDisconnectReason
  majorDiscReason = disconnectCode And &hFF

  if (disconnectCode = &hB08 or majorDiscReason = 2 or majorDiscReason = 1) and not (extendedDiscReason = 5) then
     'Switch back to login area
     ReturnToConnectPage
     exit sub
  end if
 
  errMsgText = L_DisconnectRemoteByServer_ErrorMessage
  if not extendedDiscReason = 0 then
     'Use the extended disconnect code
     select case extendedDiscReason
     case 0   errMsgText  = ""
     case 1   errMsgText  = L_DisconnectRemoteByServerTool_ErrorMessage
     case 2   errMsgText  = L_LogoffRemoteByServer_ErrorMessage
     case 3   errMsgText  = L_DisconnectIdleTimeout_ErrorMessage
     case 4   errMsgText  = L_DisconnectLogonTimeout_ErrorMessage
     case 5   errMsgText  = L_DisconnectByOtherConnection_ErrorMessage
     case 6   errMsgText  = L_ServerOutOfMemory_ErrorMessage
     case 7   errMsgText  = L_ServerDeniedConnection_ErrorMessage
     case 256 errMsgText  = L_LicenseInternal_ErrorMessage
     case 257 errMsgText  = L_NoLicenseServer_ErrorMessage
     case 258 errMsgText  = L_NoLicense_ErrorMessage
     case 259 errMsgText  = L_LicenseBadClientMsg_ErrorMessage
     case 260 errMsgText  = L_LicenseHwidDoesntMatch_ErrorMessage
     case 261 errMsgText  = L_BadClientLicense_ErrorMessage
     case 262 errMsgText  = L_LicenseCantFinishProtocol_ErrorMessage
     case 263 errMsgText  = L_LicenseClientEndedProtocol_ErrorMessage
     case 264 errMsgText  = L_LicenseBadClientEncryption_ErrorMessage
     case 265 errMsgText  = L_CantUpgradeLicense_ErrorMessage
     case 266 errMsgText  = L_LicenseNoRemoteConnections_ErrorMessage
     case else errMsgText = L_ErrMsg_Text
     end select
     if extendedDiscReason > 4096 then
        errMsgText = L_ProtocolErrWITHCODE_ErrorMessage  & errMsgText
     end if
  else
     ' no extended error information, use the disconnect code
     select case disconnectCode
     case 0   errMsgText  = L_ErrMsg_Text
     case 1   errMsgText  = L_ErrMsg_Text
     case 2   errMsgText  = L_ErrMsg_Text
     case 260 errMsgText  = L_BadServerName_ErrorMessage
     case 262 errMsgText  = L_LowMemory_ErrorMessage
     case 264 errMsgText  = L_ConnectionTimeout_ErrorMessage
     case 516 errMsgText  = L_NotResponding_ErrorMessage
     case 518 errMsgText  = L_LowMemory_ErrorMessage
     case 520 errMsgText  = L_BadServerName_ErrorMessage
     case 772 errMsgText  = L_NetworkErr_ErrorMessage
     case 774 errMsgText  = L_LowMemory_ErrorMessage
     case 776 errMsgText  = L_BadServerName_ErrorMessage
     case 1028 errMsgText = L_NetworkErr_ErrorMessage
     case 1030 errMsgText = L_SecurityErr_ErrorMessage
     case 1032 errMsgText = L_IllegalServerName_ErrorMessage
     case 1286 errMsgText = L_EncryptionError_ErrorMessage
     case 1288 errMsgText = L_BadServerName_ErrorMessage
     case 1540 errMsgText = L_BadServerName_ErrorMessage
     case 1542 errMsgText = L_SecurityErr_ErrorMessage
     case 1544 errMsgText = L_LowMemory_ErrorMessage
     case 1796 errMsgText = L_NotResponding_ErrorMessage
     case 1798 errMsgText = L_SecurityErr_ErrorMessage
     case 1800 errMsgText = L_CannotLoopBackConnect_ErrorMessage
     case 2052 errMsgText = L_BadServerName_ErrorMessage
     case 2056 errMsgText = L_LicensingNegotFailed_ErrorMessage
     case 2310 errMsgText = L_SecurityErr_ErrorMessage
     case 2566 errMsgText = L_SecurityErr_ErrorMessage
     case 2822 errMsgText = L_EncryptionError_ErrorMessage
     case 3078 errMsgText = L_EncryptionError_ErrorMessage
     case 3080 errMsgText = L_DecompressionFailed_ErrorMessage
     case 3334 errMsgText = L_ProtocolErr_ErrorMessage
     case 10500 errMsgText = L_ProtocolErr_ErrorMessage
     case else errMsgText = L_InternalErr_ErrorMessage
     end select
  end if
 
  msgbox errMsgText,0,L_DisconnectedCaption_ErrorMessage
  ReturnToConnectPage
 
end sub
-->
       </script>
</table>
</center>
</div>


</body>
</html>

Hope this helps......
Top Expert 2013

Commented:
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.
<note>
   In the absence of responses, I may recommend DELETE unless it is clear
   to me that it has value as a PAQ.  Silence = you don't care
</note>

Cd&
Top Expert 2013

Commented:
It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

<recommendation>
split thomasdodds and TallerMike

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange

TallerMike, points for you at:
http://www.experts-exchange.com/Web/Web_Languages/Q_2054116
8.html

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial