HTML Text Inputs ---> VBScript Array

Author Message
depthcharge623

  • Total Posts : 1
  • Scores: 0
  • Reward points : 0
  • Joined: 1/6/2011
  • Status: offline
HTML Text Inputs ---> VBScript Array Thursday, January 06, 2011 10:01 AM (permalink)
0
I am learning HTML and VBScript in order to add pages to my company's intranet.  I have been fairly successful learning on my own so far, but ran into a bit of a problem.  One page requires 84 of the same type of input that needs to then be manipulated before being stored in a database.  I originally named the text inputs example1, example2, example3, etc... and was then going to manipulate and save them 1 by 1 in my script by calling example1.value, then example2.value, etc.  Obviously this isn't very efficient, so I was wondering if there is a better way? 
 
Instead of naming the HTML text inputs example1, example2, example3, etc, would I be able to store them into an array?  Like example[1], example[2], example[3], etc.  Is this possible?  If so, how would I do it and then access that array in my script?
 
Any help would be greatly appreciated.
 
Thanks!
 
#1
    webber123456

    • Total Posts : 58
    • Scores: 0
    • Reward points : 0
    • Joined: 9/20/2007
    • Status: offline
    Re:HTML Text Inputs ---> VBScript Array Friday, January 28, 2011 6:59 PM (permalink)
    0
    something like this
     
    Dim example(3)

    'retrieve form values and save  data
    '-----------------------------------
    For j = 1 to request.form.count()
    Field = trim(lcase(request.form.key(j)))
    For k = 1 to 3
    If Field = "example"&k Then
    vVal  = trim(Request.Form("example"&k))
    'call a function to save data into database
    '------------------------------------------------
    Call Update_database("example"&k, vVal)
    End if
    Next
    Next
     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9