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 Coder
    Join Date
    Jun 2005
    Posts
    44
    Thanks
    2
    Thanked 0 Times in 0 Posts

    How to modify hidden value

    I have a HTML file,there are hidden parameter in in this HTML,hidden parameter name is made of "test"+number,such as
    <form name="test" id="test">
    <input type="hidden" name="test0" value="9">
    <input type="hidden" name="test1" value="5">
    <input type="hidden" name="test2" value="6">
    <input type="hidden" name="test3" value="1">
    </form>

    I want to dynamic modify the hidden value,for example
    i=3 //the value of i is get dynamic,i=2 or i=3 or any number
    test.test<i>.value="99"
    I know above sentence is error,how to write it correctly?

    Thanks!

  • #2
    gph
    gph is offline
    Regular Coder
    Join Date
    Apr 2005
    Posts
    161
    Thanks
    0
    Thanked 0 Times in 0 Posts
    document.test['test'+i].value=99;


  •  

    Posting Permissions

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