Results 1 to 19 of 19

Thread: === Resolved ====Check box in Javascript

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2001
    Location
    San Jose
    Posts
    276

    === Resolved ====Check box in Javascript

    I have a form with all records get from SQL database. Each record has a check box. If user login is 1 so they can select one or more checkboxes to delete orders. Otherwise, userlogin is 0 and they don't have permission to delete it. The userlogin is gotten from previous page and I use hidden field to store value. My Javascript code doesn't work. It didn't prompt me if I login as 0. The error at first if statement.
    ==================
    <script language ="JavaScript">
    function chkflds()
    {
    if(document.frmOrderDelete.CheckUser.value = '1')
    {
    for(var i=0;i<document.frmOrderDelete.CheckUser.length;i++)
    {
    if(document.frmOrderDelete.CheckBoxDelete[i].checked)
    {
    var confdel = confirm("Are you sure you want to delete the selected documents?")
    if( confdel)
    {
    document.frmDelete.action = "DeleteOrder.asp";
    ocument.frmDelete.submit();
    return true;
    } // end if
    } // end if checkbox checked
    else
    {
    alert("No documents selected for deletion!");
    return false;
    } // end else
    }//end for loop
    } //end if CheckUser
    else
    {
    alert("You don't have permission to delete order");
    return false;
    }
    }
    </script>
    <HTML>
    <form method="POST" name= "frmOrderDelele" ONSUBMIT="return chkflds()" >
    <% If sLogin = "Super" Then %>
    <input type="hidden" name="CheckUser" value="1" >
    <% Else %>
    <input type="hidden" name="CheckUser" value="0" >
    <% End If %>
    Last edited by learnervb; Jan 20th, 2003 at 05:08 PM.
    Tiny Mickey

Posting Permissions

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



Click Here to Expand Forum to Full Width