By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,212 Members | 1,107 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,212 IT Pros & Developers. It's quick & easy.

checkbox passing values

P: 79

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

Here is the code:

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. function valuate()
  3. {
  4.         var txt=''
  5.         var promoter=document.getElementsByName('pmid')
  6.         for (var i_tem = 0; i_tem < promoter.length; i_tem++)
  7.                 if (promoter[i_tem].checked)
  8.                         txt+=' '+promoter[i_tem].value
  9.                         txt=txt.replace(/^ /, '')
  10.                         document.forms['form1']['promoter'].value=txt
  14. }
  15. </script>
  16. <form method="post" name="form1" action="/cgi-bin/getabstracts.cgi">
  17. <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
Nov 20 '08 #1
Share this Question
Share on Google+
3 Replies

Expert Mod 15k+
P: 16,027
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.
Nov 20 '08 #2

P: 79

Thanks for the reply!!!

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

with regards
Nov 29 '08 #3

Expert Mod 15k+
P: 16,027
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.
Nov 29 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.