Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Nov 2006
    Location
    Toronto Ont. Canada
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Object required error

    I am trying to count certain checkboxs on a form to obtain a total. I have tried the standard script by Alan Gruskoff that I tried to modify and I am getting the following error Object required

    Here is the script
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Original: Alan Gruskoff (alan@performantsystems.com) -->
    <!-- Web Site: http://www.performantsystems.com/ -->

    <!-- This script and many more are available free online at -->
    <!-- The JavaScript Source!! http://javascript.internet.com -->

    <!-- Begin
    function anyCheck(form) {
    var total = 0;
    var max = form.platlist.Table3.no.length;
    for (var idx = 0; idx < max; idx++) {
    if (eval("document.platlist.Table3.no[" + idx + "].checked") == true) {
    total += 1;
    }
    }
    alert("You selected " + total + " boxes.");
    }
    // End -->
    </script>

    Here is the button

    <p><input type=button value="Count Checkboxes" onClick="anyCheck(this.form)">

    The input form is a table
    <form name="platlist" action="" method="POST">
    <!-- [BEGIN Table3] -->

    <!-- [END PRE-Table3] -->
    <table id="Table3" border="1" cellspacing="2" cellpadding="2" width="100%" style="border-left-color: rgb(128,128,128); border-top-color: rgb(128,128,128); border-right-color: rgb(128,128,128); border-bottom-color: rgb(128,128,128); height: 773;" NOFINSIDE="~! ~!" >
    <tr style="height:19px"> .......

    I have 64 check boxes on the form and I want to total up the the ones with the name = no that are checked below is the html for the one of the check boxs.

    <input id="FormsCheckbox70" type="checkbox" name="no" value="" NO FINSIDE="~! ~!" onClick="return(F_e('FormsCheckbox70', F_CL))">
    <!-- [BEGIN POST-FormsCheckbox70] -->

    When I press the button I get object required as a error code 0

    Thanks in advance

    Terry
    Last edited by TerryMan; 11-03-2006 at 05:24 PM.

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    Is that button inside the form tag?

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    New to the CF scene
    Join Date
    Nov 2006
    Location
    Toronto Ont. Canada
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No it is outside the tag as I want do to two forms.Please find the HTML attached

    Terry
    Attached Files Attached Files
    Last edited by TerryMan; 11-03-2006 at 07:14 PM.


  •  

    Posting Permissions

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