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

hidden fields

P: 1
i have code below-

<input type="hidden" name="totalrecords" value="1">
<input type="hidden" name="totalrecords" value="2">
<input type="hidden" name="totalrecords" value="3">

here name of all the hidden fields are same ,if i want to show second hidden field on next page which has value ="2" how i can show because here the name of hidden fields are same ,so by default it can show the value of first hidden field.so , plz reply me
Mar 4 '12 #1
Share this Question
Share on Google+
2 Replies


Rabbit
Expert Mod 10K+
P: 12,370
Give them different names.
Mar 4 '12 #2

jhardman
Expert 2.5K+
P: 3,405
Rabbit is right, having different inputs with the same name is a really bad idea. When you do this the value passed is actually this:
Expand|Select|Wrap|Line Numbers
  1. totalrecords = "1,2,3"
you can then use a split function to separate those values, but really, I can't think of any case where that would be easier than giving the inputs different names.

Jared
Mar 4 '12 #3

Post your reply

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