dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Object doesn't support this property or method

  1. #1
    Join Date
    Oct 2007
    Posts
    1

    Object doesn't support this property or method

    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>

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Change the value of name="action"
    Never use names that are reserved words, properties, methods or objects in JavaScript.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles