checkbox passing values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Archanak
    New Member
    • Sep 2006
    • 79

    checkbox passing values

    Hi,

    Any limits exists while passing values of checkbox to another program?

    Here is the code:

    Code:
    <script type="text/javascript">
    function valuate()
    {
            var txt=''
            var promoter=document.getElementsByName('pmid')
            for (var i_tem = 0; i_tem < promoter.length; i_tem++)
                    if (promoter[i_tem].checked)
                            txt+=' '+promoter[i_tem].value
                            txt=txt.replace(/^ /, '')
                            document.forms['form1']['promoter'].value=txt
    
    
    
    }
    </script>
    <form method="post" name="form1" action="/cgi-bin/getabstracts.cgi">
    <input name="promoter" type="hidden">
    The number of ids i am passing is 1243.

    can checkbox pass these many values?

    I am getting an error like invalid url!!!

    But is is working for 100 ids and all!!!

    Any solution?

    with regards
    Archana
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    In your code, it's actually the hidden value "promoter" which is being set. Try setting without JavaScript, e.g. by using Perl (or some other language), and see if that works. It may be a memory limit from your server language/server.

    Comment

    • Archanak
      New Member
      • Sep 2006
      • 79

      #3
      Originally posted by acoder
      In your code, it's actually the hidden value "promoter" which is being set. Try setting without JavaScript, e.g. by using Perl (or some other language), and see if that works. It may be a memory limit from your server language/server.
      Hi,

      Thanks for the reply!!!

      Is there any other method using javascript to pass all check box values!

      with regards
      Archana

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Why not avoid JavaScript use altogether and let your server-side code handle it? When you submit, the server-side code gets the values of the fields submitted. Name the checkboxes with the same name and then it should be available as a list in your server-side code. You can use something like foreach to loop over them.

        If you insist on JavaScript, you could perhaps use cookies, but they have limits of 4kb and 20 cookies per domain.

        Comment

        Working...