VBA to login to Website

raghuraman.ramesh

New Member
Joined
Dec 6, 2011
Messages
3
Hi I am unable to login to the websit. I am unable to find the Element ID fronm the Source.

HTMLDoc.forms.form1.txtUNm.Value = "40202317" - Itried this - Gives me error.
I also need for the password and Submit Button - Please help.
<<<<<<<< Source CODE of the Website is pasted below. >>>>>>>>>>>


<!--<br><b><p align=center style='font-family:arial; font-size:18px;'><img src="I/UnderConstruction.gif" width="30%"></b>-->
<html>
<head>
****** http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<!-- ****** http-equiv="Page-Exit" content="progid:DXImageTransform.Microsoft.RandomDissolve(duration=0.5)"/> -->

****** name="GENERATOR" content="Microsoft FrontPage 4.0">
****** name="ProgId" content="FrontPage.Editor.Document">
<title>HCL BSERV Intranet</title>
<link rel="stylesheet" type="text/css" href="NewIntranet/IND/css/style.css">

******** language="Javascript">
function Bookmark()
{
//bookmarkurl=******************
//bookmarktitle="HCL BSERV Intranet"
//if (document.all)
//window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
function doValidationU()
{
if (document.form1.txtUNm.value=="" )
{
alert("Please enter employeeid or hclbpo emailid.");
document.form1.txtUNm.focus();
return false;
}
if (document.form1.txtPass.value=="" )
{
alert("Please Enter Password.");
document.form1.txtPass.focus();
return false;
}
/*
if (''!='1' )
{
window.navigate("/Common/CheckServer.asp?From="+******************.href);
}
*/

document.form1.action="NewProcesslogin_global.asp";

/*



if (document.getElementById('ddlLoc').value=="1")
{
document.form1.action="NewProcesslogin_ia.asp";
}
else if (document.getElementById('ddlLoc').value=="2")
{
document.form1.action="NewProcesslogin_ia_hems.asp";
}
else if (document.getElementById('ddlLoc').value=="3")
{
//document.form1.action="NewProcesslogin_ia_ni.asp";
}*/

return true;
}
function setCookie(name, value)
{
var curCookie = name + "=" + escape(value)+ "; expires=01-Jan-2050 00:00:01 GMT";
document.cookie = curCookie;

}

/*
name - name of the desired cookie
return string containing value of specified cookie or null
if cookie does not exist
*/
function getCookie(name) {
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1) {
begin = dc.indexOf(prefix);
if (begin != 0) return null;
} else
begin += 2;
var end = document.cookie.indexOf(";", begin);
if (end == -1)
end = dc.length;
return unescape(dc.substring(begin + prefix.length, end));
}

function doSubmit()
{
//if (document.form1.chkRemberID.checked==true)
//setCookie('employeecode',document.form1.txtUNm.value);
//else
//setCookie('employeecode','false');

if(doValidationU())
document.form1.submit();
}
function myopenWindow(URL,win)
{
var width=screen.width-325, height=screen.height-350;
var left = (screen.width/2) - width/2;
var top =(screen.height/2) - height/2;
var styleStr = 'toolbar=no,location=no,directories=no,status=0,menubar=no,scrollbars=1,resizable=yes,copyhistory=no,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
************(URL,win, styleStr);
return;
}
function doBrowserComp()
{
myopenWindow("NewBrowserComp.asp","_blank");
return;
}
function doUser()
{
window.status ='HCL BSERV Intranet';
//window.showModalDialog("popup.asp",0,"dialogWidth:300px;dialogHeight:300px;center:yes;status:no")

//var cookieValue=getCookie('employeecode');

//if (cookieValue!="false" || cookieValue=="null")
//{
//document.form1.txtUNm.value=cookieValue;
//document.form1.chkRemberID.checked=true;
// }


document.form1.txtUNm.select();
document.form1.txtUNm.focus();
document.form1.txtPass.value="";

}
function Disclaimer()
{
var width=screen.width-100, height=screen.height-200;
var left = (screen.width/2) - width/2;
var top =(screen.height/2) - height/2;
open("NewIntranet/HClDisclaimer.asp","_blank","scrollbars= no toolbar=no,location=no,width=500, height=400 top=10 left=200");
}

function ISPolicy()
{
var width=screen.width-100, height=screen.height-200;
var left = (screen.width/2) - width/2;
var top =(screen.height/2) - height/2;
open("NewIntranet/HCLISPolicy.asp","_blank","scrollbars= no toolbar=no,location=no,width=500, height=400 top=10 left=200");
}


function TC()
{
var width=screen.width-100, height=screen.height-200;
var left = (screen.width/2) - width/2;
var top =(screen.height/2) - height/2;
open("NewTermsConditions1.asp","_blank","scrollbars= yes, resize=yes toolbar=no,location=no,width=800, height=600 top=10,left=100");
}

*********>

<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
</head>
<BODY topmargin="0" ******='doUser()' >
<form name="form1" method="post" onSubmit="return doValidationU()">
<table width="930" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="NewIntranet/images/LoginPageTop.jpg" width="930" height="101"></td>
</tr>
<tr>
<td height="410" valign="top" style="background-repeat:no-repeat;" background="NewIntranet/images/LoginPageContent.jpg"><table width="763" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="413" height="45"> </td>
<td width="367"> </td>
</tr>
<tr>
<td valign="top" class="tdStyle"><div align="justify">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="32" class="clockText"><strong>Welcome to the HCL BSERV Intranet. </strong></td>
</tr>
<tr>
<td class="tdStyle"><div align="justify">We have built this intranet with an objective to provide you with information and tools that will bring ease into your daily life. At the same time, intranet will help you keep updated with information related to HCL and within the BPO industry.</div></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td height="32" class="clockText"> </td>
</tr>
<tr>
<td height="180" class="tdStyle">

<!--<ul>
<li><strong>Internal Job Posting (IJP)</strong></li>
<li><strong>Industry News </strong></li>
<li><strong>International Time</strong></li>
<li><strong>Engagement Page</strong></li>
<li><strong>eCards for Birthdays and Anniversaries</strong></li>
<li><strong>Newsletters</strong></li>
<li><strong>My Contributions</strong></li>
</ul>-->


</td>
</tr>
</table>
<strong><br>
</strong></div>
<!--<marquee scrollamount="2" scrolldelay="2" bgcolor="#E1E1E1" style="padding:2px; color:#03F" class="tdContent">"No dealing period in the company's stock" from <strong>January 2 to January 17, 2012</strong></marquee>-->
</td>
<td valign="top"><table width="292" border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td height="25" class="clockText">Employee Code </td>
</tr>
<tr>
<td><input autocomplete="off" name="txtUNm" type="text" style=" BORDER-RIGHT: #666666 1px solid; BORDER-TOP: #666666 1px solid; BORDER-LEFT: #666666 1px solid; BORDER-BOTTOM: #666666 1px solid; font-size:11px; height:19px" tabindex="1" value="" size="50" maxlength="12" ></td>
</tr>
<tr>
<td height="25" class="clockText">Password</td>
</tr>
<tr>
<td><input autocomplete="off" onKeyPress="if ((event.keyCode ==13)) javascript:doSubmit();" type="password" tabindex="2" name="txtPass" size="50" style=" BORDER-RIGHT: #666666 1px solid; BORDER-TOP: #666666 1px solid; BORDER-LEFT: #666666 1px solid; BORDER-BOTTOM: #666666 1px solid ; font-size:12px"></td>
</tr>
<tr>
<td height="25" class="BAGLinks"><!-- <a href="ResetPassword.asp">Reset Password</a>-->
<a href="ResetPassword.asp">Reset Password</a>
</td>
</tr>
<tr>
<td height="43">
</td>
</tr>
<tr>
<td height="36" class="tdStyle">
<input type="checkbox" name="chkRemberID" tabindex="3">

Remember me</td>
</tr>
<tr>
<td height="56" valign="bottom"><a href="javascript:doSubmit();"><img style="behavior: url(NewIntranet/IND/css/iepngfix.htc); " src="NewIntranet/images/signInBtn.png" width="131" height="46" border="0"></a></td>
</tr>
</table></td>
</tr>
<tr>
<td height="46"> </td>

<td > </td>

</tr>
<tr>
<td height="33" style="height:20px;"><div align="left"></div></td>

<td style="height:20px;"><div align="right"><a href="http://en.wikipedia.org/wiki/Republic_Day_(India)" target="_blank" style="cursor:hand; cursor:pointer; width:50px;" title="Click to know about Republic Day of India"></a></div></td>
</a>

</tr>
<tr>
<td class="tdStyle"><span class="tdStyle">Copyright © 2012 HCL Technologies Ltd. All Rights Reserved. </span></td>
<td class="footerLinks"><div align="right"><span class="style1"><a href="javascript:Disclaimer()" class="footerLinks style1">Disclaimer</a> | <a href="javascript:ISPolicy()">Information Security Policy</a> | <a href="javascript:TC()">Terms & Conditions</a></span></div></td>
</tr>
</table></td>
</tr>
</table>

</form>
</BODY>
</html>
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,215,474
Messages
6,125,024
Members
449,204
Latest member
LKN2GO

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top