hidden fields

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anupam suman
    New Member
    • Mar 2012
    • 1

    hidden fields

    i have code below-

    <input type="hidden" name="totalreco rds" value="1">
    <input type="hidden" name="totalreco rds" value="2">
    <input type="hidden" name="totalreco rds" 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
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Give them different names.

    Comment

    • jhardman
      Recognized Expert Specialist
      • Jan 2007
      • 3405

      #3
      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:
      Code:
      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

      Comment

      Working...