Hi, i keep getting this error Object doesn't support this property or method on the line "document.getElementById("loginForm").action=business_link;"
This only happens in internet explorer and works fine in firefox, does anyone know what i am doing wrong?
<html>
<head>
<script src="https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
function init()
{
sforceClient.init("{!API.Session_ID}", "{!API.Partner_Server_URL_90}");
var qr = sforceClient.query("Select Id, Name, Business_Id__c From Account Where Id = '{!Account.Id}'");
var rs = qr.records[0];
var hasBussinessId = true;
//alert(window.navigator.appName + " " + window.navigator.appVersion);
//alert(qr.toString());
//alert(rs.get("Business_Id__c"));
if(rs.get("Business_Id__c") == null || rs.get("Business_Id__c") == undefined)
{
hasBussinessId = false;
var msg = "Account is missing Business Id, this process will now terminate.\n"
msg += "Please contact the system administrator for more information."
alert(msg);
window.close();
}
try{
if(hasBussinessId)
{
var business_link = "https://www.touchtarget.com/manage/business/"
business_link += "contract/history?id="+ rs.get("Business_Id__c");
alert(business_link);
document.getElementById("loginForm").action=business_link;
document.getElementById("loginForm").submit();
}
}
catch(err)
{
alert(err.description);
}
}
</script>
</head>
<body onload="init()">
<form name="loginForm" id="loginForm" method="POST">
<input type="hidden" name="username" value="*******">
<input type="hidden" name="password" value="*******">
<input type="hidden" name="action" value="login">
</form>
</body>
</html>


Reply With Quote
Bookmarks