Solved

VB Script Login to Webpage

Posted on 2011-09-03
12
924 Views
Last Modified: 2012-05-12
Getting error in vbs.  The problem I am having is the input name attribute contain $

Brings up page but does not apply account number to input field and password to input field for password

Can anyone help
Thanks

VBS
 
Dim objIE
Dim strtext
Dim strpasstext
Dim strbutton

strtext = "DisplayExpressTopNav1" & Chr(36) & "TextboxLogin"
strpasstext = "DisplayExpressTopNav1" & Chr(36) & "TextboxPassword"
strbutton = "DisplayExpressTopNav1" & Chr(36) & "ButtonLogin"


Set objIE = WScript.CreateObject("InternetExplorer.Application")

objIE.Navigate "http://www.tab.com.au/ExpressBet/LoginFrame.aspx?State=2&ExpressBetMode=Standard"
objIE.Visible = true

While objIE.Busy = true
	WScript.Sleep 100
Wend


objIE.Document.form1.DisplayExpressTopNav1$TextboxLogin.value = "test"
objIE.Document.form1.strpasstext.Value = "test"

objIE.Document.form1.strbutton.Click

Open in new window


page source
 
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><title>

</title><link href="/Shared/Styles/common_login.css?v=5.14.2.0" rel="stylesheet" type="text/css" /><link href="/Shared/Styles/common_login.css?v=5.14.2.0" rel="stylesheet" type="text/css" /><link href="/Shared/Styles/sty_express.css?v=5.14.2.0" rel="stylesheet" type="text/css" /></head>
<body>
    <form name="form1" method="post" action="LoginFrame.aspx?State=2&amp;ExpressBetMode=Standard" id="form1">
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTc2ODc2NTE2NA9kFgICBA9kFgwCAQ8PFgYeCEltYWdlVXJsBTIvU2hhcmVkL0ltYWdlcy9FeHByZXNzQmV0L2Vu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//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>


<script src="/WebResource.axd?d=bR6C-CV5y3I7IIexwpGorw2&amp;t=634460446983917618" type="text/javascript"></script>


<script src="/Shared/Scripts/Shared/GlobalCompiled.js?v=5.14.2.0" type="text/javascript"></script>
<script src="/Shared/Scripts/Shared/DeepMetrixCompiled.js?v=5.14.2.0" type="text/javascript"></script>
<script src="/Shared/Scripts/shared/CookieCompiled.js?v=5.14.2.0" type="text/javascript"></script>
<script src="/Shared/Scripts/expressbet/XmlHttpCompiled.js?v=5.14.2.0" type="text/javascript"></script>
<script src="/Shared/Scripts/ExpressBet/XmlHttpControlsCompiled.js?v=5.14.2.0" type="text/javascript"></script>
<script src="/Shared/Scripts/expressbet/PageManagerCompiled.js?v=5.14.2.0" type="text/javascript"></script>
<script src="/Shared/Scripts/ExpressBet/NextToGoCompiled.js?v=5.14.2.0" type="text/javascript"></script>
<script src="/Shared/Scripts/ExpressBet/UtilityCompiled.js?v=5.14.2.0" type="text/javascript"></script>
<script src="/Shared/Scripts/ExpressBet/CookieCallbackCompiled.js?v=5.14.2.0" type="text/javascript"></script>
<script src="/Shared/Scripts/Shared/CookieCompiled.js?v=5.14.2.0" type="text/javascript"></script>
<script src="/Shared/Scripts/ExpressBet/LoginCompiled.js?v=5.14.2.0" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=AU1FFUZ27DfOgnOcLIW0BL6psinTL2AnaXefjH202GZ1H0R3e8aQZBlabwT6nrubSzBmBhiQ_eXMwPERhGFfpZpH9KBmPWjSHvv_eYKxEgQ1&amp;t=ffffffff825547af" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=AU1FFUZ27DfOgnOcLIW0BL6psinTL2AnaXefjH202GZ1H0R3e8aQZBlabwT6nrubLaIyDxDLd4jDKelELS4YccqwQOoGQMZwUB1AItKHvu41&amp;t=ffffffff825547af" type="text/javascript"></script>
<div>

	<input type="hidden" name="__PREVIOUSPAGE" id="__PREVIOUSPAGE" value="PlM6Byao-2PsH9j-c3J9Ug5oQpIjeWJUwL_wrIQpBqA1" />
	<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBQKa9ouHAQKWz4GjAQLqnuqYBwLqysTwCgLjscrzDNE1YufDiB0WX4zTrCjod3Tg30c1" />
</div>
    <script type="text/javascript">
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('ScriptManager1', document.getElementById('form1'));
Sys.WebForms.PageRequestManager.getInstance()._updateControls(['tDateUpdatePanel'], [], [], 90);
//]]>
</script>

    <table width="100%" border="0" cellpadding="0" cellspacing="0" id="Header" style="height: 57px;">
        <tr>
            <td style="width: 98px; vertical-align: top">
                <a href="/Racing/Default.aspx?State=2" target="_parent">
                    <img id="ImageExpress" title="TAB Sportsbet - Horse Racing - Greyhound Racing - Harness Racing - Home" src="/Shared/Images/ExpressBet/en-au/expressBET_NSW.gif" alt="TAB Sportsbet - Horse Racing - Greyhound Racing - Harness Racing - Home" style="border-width:0px;" /></a>
            </td>
            <td style="width: 180px; vertical-align: middle; white-space: nowrap;">
                <a href="javascript:void(0)" onclick="OpenPopup('/Login/JoinNow.aspx?State=2&amp;ReferringPageType=ExpressBetStandard&amp;ReturnUrl=/ExpressBet/LoginFrame.aspx%3fState%3d2%26ExpressBetMode%3dStandard', 'JoinNowWindow', '640', '480', 'no');WriteParentUrl( 'http://www.tab.com.au/ExpressBet/LoginFrame.aspx?State=2&amp;ExpressBetMode=Standard' );"><img alt='' align="top" src='/Shared/Images/ExpressBet/en-au/joinNow_blueBG.gif' style="vertical-align:top;border:none;"/></a>                
            </td>
            <td width="390px">
                <div id="ErrorMessageDiv" style="display: none;position:absolute;top:0;">
                    <input type="hidden" id="ErrorMessageFocus" value="" />
                    <table cellpadding="0" cellspacing="0" border="0" class="LoginErrorExpressMessage" style="height:28px;width:480px">
                        <tr>
                            <td style="width:7px">
                                <img alt="" src="/Shared/Images/AccountManagement/en-au/gra_spacer.gif" width="7" height="1" />
                            </td>                          
                            <td style="width:23px">
                                <img alt="" id="ExclamationImage" src="/Shared/Images/Sports/en-au/error_icon.gif" />
                            </td>
                            <td style="width:5px">
                                <img alt="" src="/Shared/Images/AccountManagement/en-au/gra_spacer.gif" width="5" height="1" />
                            </td>
                            <td style="width:auto;vertical-align: middle;">
                                <span id="ErrorMessageLabel" style="font-size:11px;font-family:Arial;color:#ffffff;"></span>
                            </td>
                            <td style="width:39px;white-space: nowrap; color: #ffffff; vertical-align: middle;text-align:right;">
                                <a id="ErrorMessageCloseLabel" class="CloseLinkDefault" onclick="CloseErrorMessage();" href="javascript:void(0);">Close</a>
                            </td>
                            <td style="width:5px">
                                <img alt="" src="/Shared/Images/AccountManagement/en-au/gra_spacer.gif" width="5" height="1" />
                            </td>                            
                            <td style="width:13px">
                                <img alt="" class="CloseImageDefault" align="top" id="CloseImage" src="/Shared/Images/Sports/en-au/error_close_btn.gif" onclick="CloseErrorMessage();" />
                            </td>
                            <td style="width:7px">
                                <img alt="" src="/Shared/Images/AccountManagement/en-au/gra_spacer.gif" width="7" height="1" />
                            </td>  
                        </tr>
                    </table>
                </div>
                <img alt="" src="/Shared/Images/AccountManagement/en-au/gra_spacer.gif" width="1px" height="1px" />
            </td>
            <td>
                <table width="330px" border="0" cellpadding="0" cellspacing="0" id="Table1" align="right">
                    <tr>
                        <td style="width: 100px; vertical-align: middle; white-space: nowrap; text-align: right">
                            <a id="HyperLinkMode" href="/ExpressBet/Expert/Default.aspx?State=2" target="_parent">EXPERT MODE</a>
                        </td>
                        <td style="width: 85px; white-space: nowrap; vertical-align: middle; text-align: right" class="whiteText">
                            <div id="DateUpdatePanel">
	
                                    <b>
                                        
                                        <span id="clock">&nbsp;</span></b>                                        
                                
</div>
                        </td>
                        <td style="width: 145px; padding-right: 5px; text-align: right">
                            <select name="ddlMyAccount" id="ddlMyAccount" class="accountSelect" onchange="eval(document.getElementById('ddlMyAccount').options[document.getElementById('ddlMyAccount').selectedIndex].value);document.getElementById('ddlMyAccount').selectedIndex=0;CcAddCallback(PM_LOGIN_REFRESH_CALLBACK_COOKIENAME + ',' + PM_LOGIN_REFRESH_CALLBACK_COOKIEKEY, PmPostLoginRefresh);CcStartListener();">
	<option selected="selected" value="">My Account</option><option value="SetGenericAlertForLogin('Please log in and select &quot;My Details&quot; again.');">My Details</option><option value="SetGenericAlertForLogin('Please log in and select &quot;Balance&quot; again.');">Balance</option><option value="SetGenericAlertForLogin('Please log in and select &quot;Statement&quot; again.');">Statement</option><option value="SetGenericAlertForLogin('Please log in and select &quot;Deposit&quot; again.');">Deposit</option><option value="SetGenericAlertForLogin('Please log in and select &quot;Withdraw&quot; again.');">Withdraw</option><option value="SetGenericAlertForLogin('Please log in and select &quot;My Popup&quot; again.');">My Popup</option><option value="SetGenericAlertForLogin('Please log in and select &quot;Preferences&quot; again.');">Preferences</option><option value="window.open('/Racing/Information/Results/Default.aspx?State=2&ParentUrl=http%3a%2f%2fwww.tab.com.au%2fExpressBet%2fStandard%2fDefault.aspx%3fState%3d2%26ExpressBetMode%3dStandard&SmallSize=PopUpLoginSmallSize&ReferringPageType=ExpressBetStandard', 'Results', 'height=540,width=840,screenX=10,screenY=25,left=10,top=25,scrollbars=yes,directories=no,toolbars=yes,menubar=yes,dependent=yes,status=yes,resizable=yes');WriteParentUrl( 'http://www.tab.com.au/ExpressBet/Standard/Default.aspx?State=2&ExpressBetMode=Standard' );">Results</option>
</select>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td height="10" width="98" valign="top" align="left">
                <a href="/ExpressBet/Standard/Default.aspx?State=2&Home=True" target="_parent">
                    <img alt="ExpressBET" src="/shared/Images/ExpressBet/en-au/expressBet_blueBG.gif" border="0" title="About ExpressBET" /></a>
            </td>
            <td height="20" align="left" valign="top" class="padRight whiteText padBottom" colspan="3">
                

<script type="text/javascript">
var msgNotLoggedIn = 'You are currently not logged in to tab.com.au.';
var msgSelectBetNow = 'Please log in and select "Bet Now" again to place your bet.';
var msgSelectJoinNow = 'Select Join Now to open an account with Tabcorp.';
var msgSelectMyAccount = 'Please log in and select "My Account" to view your account.'; 
var setLoginFocusCount = 0;
var maskedPasswordTextBox;
var unmaskedPasswordTextBox;

function getBrowser()
{
    var browser =navigator.appName;
    if(browser.indexOf("Internet Explorer") > -1)
        browser = "IE";

    return browser;
}

function DoPrefreshActions()
{
    document.getElementById("DisplayExpressTopNav1_GetAccountBalanceFromCam").value="true";
    document.getElementById("DisplayExpressTopNav1_ButtonRefreshLink").style.display="none";
    document.getElementById("DisplayExpressTopNav1_AjaxLoaderRefresh").style.display="inline";
}

function CheckTextLimit(evt,field) {
    if (evt.which && evt.which == 8) 
    {
        return true;
    }
    else 
    {
        SelectLoginTextBox();
        return (field.value.length < 8);
    }
}

function SelectLoginTextBox()
{
    if (document.getElementById("DisplayExpressTopNav1_TextboxLogin").value == "Account Number")
    {
        document.getElementById("DisplayExpressTopNav1_TextboxLogin").value = '';
        SwapLoginTextBox('true');    
    }
} 

function SetAlertForLoginStandard()
{
    alert(msgNotLoggedIn + '\n\n' + msgSelectBetNow + '\n\n' + msgSelectJoinNow);
    SetFocusPostAlert();
}
function SetAlertForLoginMyAccount()
{
    alert(msgNotLoggedIn + "\n\n" + msgSelectMyAccount + '\n\n' + msgSelectJoinNow);
    SetFocusPostAlert();
}
function SetGenericAlertForLogin(msg)
{
    alert(msgNotLoggedIn + "\n\n" + msg + "\n\n" + msgSelectJoinNow);
    SetFocusPostAlert();
}

function SetFocusPostAlert()
{
    SelectLoginTextBox();
    FocusLoginTextBox();
}

function FocusLoginButton()
{
    document.getElementById("DisplayExpressTopNav1_ButtonLogin").focus();
} 

function FocusLoginTextBox()
{
    document.getElementById("DisplayExpressTopNav1_TextboxLogin").focus();
} 

function ValidateLoginInputs()
{
    var NoAccountNumber = "Please enter your account number." ; // “Please enter your Account Number” 
    var AccountNumberInvalid = "Your account number is invalid. Your account number can be 6 - 8 characters long and contain only numbers." ; // “Your Account number is invalid. Your account number can be at most 6 to 8 characters long and only contain numbers” 
    var NoPassword = "Please enter your password." ; // “Please enter your Password” 
    var PasswordTooShort = "Your password must be a minimum of 8 alpha numeric characters long. (No spaces allowed.)" ; // “Please enter a password that is at least 8 characters”
    var CloseMessage = "Close"
    
    var username = document.getElementById("DisplayExpressTopNav1_TextboxLogin");
    var password = document.getElementById("DisplayExpressTopNav1_TextboxPassword");
    
    /*
    while(username.value.charAt(0)=='0')
    {
        username.value=username.value.substring(1);
    }
    */
    
    if(username.value.length == 0 || username.value == "Account Number")
    {
        ShowErrorMessage(NoAccountNumber, 'DisplayExpressTopNav1_TextboxLogin');
        return false;
    }
    else if (username.value.length < 6)
    {
        ShowErrorMessage(AccountNumberInvalid, 'DisplayExpressTopNav1_TextboxLogin');
        return false;
    }
    else if (isNaN(username.value))
    {
        ShowErrorMessage(AccountNumberInvalid, 'DisplayExpressTopNav1_TextboxLogin');
        return false;
    }
    else if(password.value == '')
    {
        ShowErrorMessage(NoPassword, 'DisplayExpressTopNav1_TextboxPassword');
        return false;
    }
    else if(password.value.length < 7)
    {
        ShowErrorMessage(PasswordTooShort, 'DisplayExpressTopNav1_TextboxPassword');
        return false;
    }
    
    return true;

}

function ValidateBetSubmit(alertMessage, submitFunction)
{
    if (PmAuth==true)
    {
        eval("parent." + submitFunction);
    }
    else
    {
        SetGenericAlertForLogin(alertMessage);      
    }
}   
   
function PasswordTextBoxOnEnter(swapToAllowUserInput)
{
     var browser = getBrowser();
     var oldTextBox = document.getElementById("DisplayExpressTopNav1_TextboxPassword");
     if(oldTextBox.value == "Password")
     {
        if (browser=="IE")
        {
            // it is unmasked
            unmaskedPasswordTextBox = oldTextBox;
            var np= oldTextBox.cloneNode(true);
            np.type='password';           
            oldTextBox.parentNode.replaceChild(np,oldTextBox); 
            np.setAttribute("onfocus", null);
            np.value = '';
            np.focus();
            np.select();
          }
          else
          {
            oldTextBox.setAttribute("onfocus", null); 
            oldTextBox.type='password'; 
            oldTextBox.value = '';
            oldTextBox.focus();
            oldTextBox.select();
          }
          return;
     }
 
}

function PasswordTextBoxOnBlur()
{
    var browser = getBrowser();
        
    var oldTextBox = document.getElementById("DisplayExpressTopNav1_TextboxPassword");
    
        if (browser=="IE")
        {
            if(oldTextBox.value == '') // 
            {
                oldTextBox.parentNode.replaceChild(unmaskedPasswordTextBox,oldTextBox);  
                return;
            }
        }
        else    // safari and firefox play nicely.
        {
            if(oldTextBox.value == '') // restore
            {
                oldTextBox.setAttribute("onfocus", "PasswordTextBoxOnEnter();"); // fix
                oldTextBox.value = "Password";
                oldTextBox.type='text';                 
            }
        }
     
}

function SwapLoginTextBox(swapToAllowUserInput)
{
    var browser = getBrowser();
    
    if (browser=="IE")
    {
        if(swapToAllowUserInput == 'true')
        {
            var oldTextBox = document.getElementById("DisplayExpressTopNav1_TextboxLogin")
            var np= oldTextBox.cloneNode(true);    
            np.setAttribute("onfocus", null);
            np.maxLength=8;
            oldTextBox.parentNode.replaceChild(np,oldTextBox);
            np.focus();
            np.select();
            return;
        }
        else
        {
            var oldTextBox = document.getElementById("DisplayExpressTopNav1_TextboxLogin")
            if(oldTextBox.value == '')
            {
                var np= oldTextBox.cloneNode(true);    
                np.setAttribute("onfocus", "SelectLoginTextBox(true);");
                np.maxLength=20;
                np.value = "Account Number";
                oldTextBox.parentNode.replaceChild(np,oldTextBox);
            }
            return;
        }
    }
    else    // standards compliant browsers
    {
        if(swapToAllowUserInput == 'true')
        {
            var oldTextBox = document.getElementById("DisplayExpressTopNav1_TextboxLogin")
            oldTextBox.setAttribute("onfocus", null);
            oldTextBox.maxLength=8;
            oldTextBox.focus();
            oldTextBox.select();
            return;
        }
        else
        {
            var oldTextBox = document.getElementById("DisplayExpressTopNav1_TextboxLogin")
            if(oldTextBox.value == '')
            {
                oldTextBox.setAttribute("onfocus", "SelectLoginTextBox(true);");
                oldTextBox.maxLength=20;
                oldTextBox.value = "Account Number";                
            }
            return;
        }
    
    }
}

var Account_Cookie_Name = "Account";
var Account_Cookie_Key = "Account_DisplayBalance";
function ToggleAccountBalanceView()
{
  var today = new Date();
  var expiry = new Date(today.getTime() + 1095 * 24 * 60 * 60 * 1000); // plus 1095 days (3 years)  
  var cookieAccountValue =  GetCookieValue(Account_Cookie_Name);  
  var HideOrShow = document.getElementById("DisplayExpressTopNav1_LinkHideShowAccountBalance");
  
  if(HideOrShow.innerHTML == HideAccountBalance)
    HideOrShow.innerHTML = ShowAccountBalance;
   else
    HideOrShow.innerHTML = HideAccountBalance;
  
  // could make this nicer
  if(cookieAccountValue == null || (cookieAccountValue.indexOf("Account_DisplayBalance=1") > -1))
  {
      AddSessionCookie(Account_Cookie_Name, Account_Cookie_Key, "0", "/", "tab.com.au", "");
    HideShowAccountBalanceControls("hidden");                    
  }
  else
  {
      AddSessionCookie(Account_Cookie_Name, Account_Cookie_Key, "1", "/", "tab.com.au", "");
    HideShowAccountBalanceControls("visible");
  }
    
}

// flip controls  
function HideShowAccountBalanceControls(HideShow)
{
    document.getElementById("DisplayExpressTopNav1_LabelBalance").style.visibility=HideShow;
    document.getElementById("DisplayExpressTopNav1_LabelAccountNumber").style.visibility=HideShow;
    document.getElementById("DisplayExpressTopNav1_LabelPipe5").style.visibility=HideShow;
    document.getElementById("DisplayExpressTopNav1_LabelBalance").style.visibility=HideShow;
    document.getElementById("DisplayExpressTopNav1_LabelBalanceTime").style.visibility=HideShow;
    document.getElementById("DisplayExpressTopNav1_LabelPipe1").style.visibility=HideShow;
   
        // need this one to collapse
    SwapNodes(HideShow);
    // need this one to collapse
    if(HideShow == 'hidden')
    {
        document.getElementById("DisplayExpressTopNav1_ButtonRefreshLink").style.display = 'none';
        //document.getElementById("DisplayExpressTopNav1_LabelPipe6").style.visibility='none';
        document.getElementById("DisplayExpressTopNav1_LabelPipe6").style.display='none';
    }
    if(HideShow == 'visible')
    {
        document.getElementById("DisplayExpressTopNav1_LabelPipe6").style.display='inline';
        document.getElementById("DisplayExpressTopNav1_ButtonRefreshLink").style.display='inline';
    }
}

    function SwapNodes(HideShow)
      {
           var browser = getBrowser();
            if (browser=="IE")
            {
                var swapOne = document.getElementById("DisplayExpressTopNav1_LinkHideShowAccountBalance");
                var swapTwo = document.getElementById("DisplayExpressTopNav1_ButtonRefreshLink");
                if(HideShow == "hidden")
                {
                    swapOne.swapNode(swapTwo);
                }
                else
                {
                    swapTwo.swapNode(swapOne);
                }
            }
      }
</script>
<table cellspacing="0" cellpadding="0" border="0">
	<tr>
	    <!-- Added below code for TT28711 HALO - Insert 'Home' hyperlink into header area -->
	    <td class="LinksTD" nowrap="nowrap" style="padding-left:1px;">
		     <!-- Home Hyper Link to www.tab.com.au -->
			 <a id="DisplayExpressTopNav1_HomeHyperlink"><a class="LoginBarLinkDefault" onclick="" onmouseover="this.className='LoginBarMouseOver'" onmouseout="this.className='LoginBarLinkDefault'" href="/Default.aspx" target="_parent">Home</a></a>
			 <!-- | -->
			 <span id="DisplayExpressTopNav1_LabelHome" class="LoginBarPipe">|</span>
		</td>	
		
		
	    <td style="white-space: nowrap;text-align: left;">
		    
                <!-- Account Number Field -->
                <input name="DisplayExpressTopNav1$TextboxLogin" type="text" value="Account Number" id="DisplayExpressTopNav1_TextboxLogin" tabindex="2" onblur="SwapLoginTextBox(false)" onkeypress="return CheckTextLimit(event, this);" onclick="SelectLoginTextBox();" class="LoginTextField" style="width:85px;" />
                <!-- Password Field -->
                <input name="DisplayExpressTopNav1$TextboxPassword" type="text" value="Password" id="DisplayExpressTopNav1_TextboxPassword" tabindex="3" onblur="PasswordTextBoxOnBlur()" onfocus="PasswordTextBoxOnEnter();" class="PasswordTextField" style="width:85px;" />
                <!-- Login Button -->
                <input type="submit" name="DisplayExpressTopNav1$ButtonLogin" value="" onclick="if(!ValidateLoginInputs()){return false;};WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;DisplayExpressTopNav1$ButtonLogin&quot;, &quot;&quot;, false, &quot;&quot;, &quot;https://www.tab.com.au/Login/LoginUser.aspx?State=2&amp;ReturnURL=http%3a%2f%2fwww.tab.com.au%2fExpressBet%2fLoginFrame.aspx%3fState%3d2%26ExpressBetMode%3dStandard&quot;, false, false))" id="DisplayExpressTopNav1_ButtonLogin" tabindex="4" class="LoginButton" style="border-style:None;" /><input type="hidden" name="DisplayExpressTopNav1$ShowBetSlipOnLogin" id="DisplayExpressTopNav1_ShowBetSlipOnLogin" value="false" />
                <!-- Forgot Field -->
                <span id="DisplayExpressTopNav1_LabelForgot" class="LoginBarText">Forgotten</span>
                <!-- Account Number Link -->
                <a class="LoginBarLinkDefault" onclick="" onmouseover="this.className='LoginBarMouseOver'" onmouseout="this.className='LoginBarLinkDefault'" href="http://nettab.custhelp.com/cgi-bin/nettab.cfg/php/enduser/std_adp.php?p_sid=YuEE*48h&amp;p_lva=&amp;p_faqid=3" target="_blank">Account Number</a>
                <!-- or -->
                <span id="DisplayExpressTopNav1_LabelOr" class="LoginBarText">or</span>
                <!-- PasswordLink -->
                <a href="javascript:void(0);" onclick="OpenPopup('https://www.tab.com.au/AccountManagement/AccountHolder/Password/RetrieveForgottenPasswordDefault.aspx?State=2&amp;amp;ReferringPageType=ExpressBetStandard&amp;amp;ParentUrl=/ExpressBet/LoginFrame.aspx%3fState%3d2%26ExpressBetMode%3dStandard', 'MyStateWindow', '640', '530', 'no');WriteParentUrl('http://www.tab.com.au/ExpressBet/LoginFrame.aspx?State=2&amp;ExpressBetMode=Standard');" class="LoginBarLinkDefault" onmouseover="this.className='LoginBarMouseOver'" onmouseout="this.className='LoginBarLinkDefault'">Password</a>				
	            <span class ="LoginBarText" style="margin-left:-2px;">?</span>	
            
                <span class="LoginBarPipeNarrow">|</span>
                <!-- My State -->
                <a href="javascript:void(0);" id="DisplayExpressTopNav1_anchorMyState" class="LoginBarLinkDefault" onclick="OpenPopup('/AccountManagement/MyState/MyStatePopup.aspx?State=2&amp;ParentUrl=%2fExpressBet%2fStandard%2fDefault.aspx%3fState%3d2&amp;SmallSize=PopUpLoginSmallSize&amp;ReferringPageType=ExpressBetStandard&amp;PageAuthorisation=', 'Login', '650', '485');WriteParentUrl( 'http://www.tab.com.au/ExpressBet/LoginFrame.aspx?State=2&amp;ExpressBetMode=Standard' );" onmouseover="this.className='LoginBarMouseOver'" onmouseout="this.className='LoginBarLinkDefault'">My State</a>
                <!--|-->
                <span id="DisplayExpressTopNav1_LabelPipe3" class="LoginBarPipeNarrow">|</span>
                <!-- Help -->
                <a class="LoginBarLinkDefault" onclick="" onmouseover="this.className='LoginBarMouseOver'" onmouseout="this.className='LoginBarLinkDefault'" href="http://nettab.custhelp.com" target="_blank">Help</a>
		</td>
	</tr>
</table>


            </td>
        </tr>
    </table>
    <script type="text/javascript" >
//reparse=true;
PmSetAuth(false);PmSetUsersBetType('WinPlace');</script>
    

<script type="text/javascript">
//<![CDATA[
var Jurisdiction = 'State=2';try{executeDeepMetrix('//deepmetrix.tab.com.au/dm.gif?');} catch (err) { }FocusLoginButton();
            if(clock != null){
                clock.destroy();
            } 
            clock = new WorldTime('05/09/2011 16:15', {clockFormat: 'e', elementId: 'clock', timeZone: ' AEST'}).init();
            //Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function(){clock.destroy();});
            FocusFirstFormField();Sys.Application.initialize();
//]]>
</script>
</form>
</body>
</html>

Open in new window

0
Comment
Question by:Jason
  • 7
  • 3
  • 2
12 Comments
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 36479995
I'm not able to test right now but I was thinking along the lines of form1.elements(strtxt).value ...

Looking at http://msdn.microsoft.com/en-us/library/ms537457(v=vs.85).aspx however, you should be able to use:

objIE.Document.forms("form1", strtext).value = "test"
objIE.Document.forms("form1", strpasstext).Value = "test"

objIE.Document.forms("form1", strbutton).Click

Open in new window

0
 

Author Comment

by:Jason
ID: 36480387
HI

Errors VBS Error
0
 
LVL 45

Expert Comment

by:Martin Liss
ID: 36480490
Try

strtext = ["DisplayExpressTopNav1" & Chr(36) & "TextboxLogin"]
0
 

Author Comment

by:Jason
ID: 36480528
No Joy

empty strtext and error on same line
 empty variables error
0
 
LVL 45

Expert Comment

by:Martin Liss
ID: 36480591
Okay, I'm not a VBScript person but try this

strtext = "DisplayExpressTopNav1$TextboxLogin"
0
 

Author Comment

by:Jason
ID: 36480661
done that doesn't work error on same line same error
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 35

Accepted Solution

by:
Robert Schutt earned 500 total points
ID: 36480720
Actually got around to testing it and my first idea does work. Try this:

objIE.Document.form1.elements(strtext).Value = "test"
objIE.Document.form1.elements(strpasstext).Value = "test"

objIE.document.form1.submit()

Open in new window

0
 

Author Comment

by:Jason
ID: 36480966
HI Robert

The only thing that is not working is the submit.

The Acc gets entered and the gets entered bot the submit does not occur
0
 

Author Comment

by:Jason
ID: 36480971
This is the source for submit

<input type="submit" name="DisplayExpressTopNav1$ButtonLogin" value="" onclick="if(!ValidateLoginInputs()){return false;};WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;DisplayExpressTopNav1$ButtonLogin&quot;, &quot;&quot;, false, &quot;&quot;, &quot;https://www.tab.com.au/Login/LoginUser.aspx?State=2&amp;ReturnURL=http%3a%2f%2fwww.tab.com.au%2fExpressBet%2fLoginFrame.aspx%3fState%3d2%26ExpressBetMode%3dStandard&quot;, false, false))" id="DisplayExpressTopNav1_ButtonLogin" tabindex="4" class="LoginButton" style="border-style:None;" /><input type="hidden" name="DisplayExpressTopNav1$ShowBetSlipOnLogin" id="DisplayExpressTopNav1_ShowBetSlipOnLogin" value="false" />
0
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 36481001
Sorry I didn't see that onclick code, most of the time code like that is in the onsubmit code I think. Maybe your original works better in combination with the use of 'elements'?

objIE.Document.form1.elements(strbutton).Click

Open in new window

0
 

Author Comment

by:Jason
ID: 36481073
Robert Your a champ

I will need further help with this.  I will new post with what I need

If you could help that would be great

Thanks Heaps

0
 

Author Comment

by:Jason
ID: 36486554
Robert

If you can help just did a new post

Heading:
Extracting from webpage using vbs and writing into excel cell

Thanks
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

In this article we want to have a look at the directory attributes which are used by Microsoft to store the so called Security Identifiers (SID). These SIDs plays an important role in delegating and granting permissions and in authentication of trus…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now