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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How can we compare checkbox value with set of array values....

    If i select a value from dropdown list then the corresponding check box should be checked...for this i have to compare the checkbox value with array value...how to do this.
    this is my javascript code.Pls help me...........

    function SelRole()
    {
    var r
    var n,p,q,a,k,len
    var table = new Array()
    var Arr = new Array()
    var Arr1,Arr2,Arr3,j,Flag
    var Flag
    Flag='N'
    q = <%=RCount%>;
    r = <%=UserCount%>;

    <%For n = 0 to RCount -1 %>
    <%Response.write("table["&n&"] = frmAddress.hiduserid"&n&".value")%>
    //alert(table[2])
    <%next%>

    <%For p = 0 to UserCount -1 %>
    <%Response.write("Arr["&p&"] = frmAddress.hidnewuserid"&p&".value")%>
    //alert(Arr[0])
    <%next%>

    <%For p = 0 to UserCount -1 %>
    alert(Arr[p])
    <%For n = 0 to RCount -1 %>
    //alert(table[n])
    if(frmAddress.chkUID<%=p%>.value == Arr[p]){
    frmAddress.chkUID<%=p%>.checked = true;
    }
    else{
    return false;
    }
    <%Next%>
    <%Next%>

    }

  • #2
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeå, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Could you post how this code looks AFTER the server side code has runs? I.e. the code that the browser is actually going to be trying to run?
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards


  •  

    Posting Permissions

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