Saving into an array from a FORM

Results 1 to 3 of 3

Thread: Saving into an array from a FORM

  1. #1
    Britton Guest

    Default Saving into an array from a FORM

    Hey everyone,<BR><BR>I&#039m trying to save data posted from a FORM to an array.... there is only one ELEMENT from the FORM, but it is a MULTIPLE SELECT object. The values returned are seperated by commas, but I can&#039t seem to be able to save them into an array... any help.<BR><BR>Britton

  2. #2
    Ben Roy Guest

    Default RE: Saving into an array from a FORM

    I believe you can just do:<BR><BR>arr = Split(strSubmitted)<BR><BR>The function allows you to specify what separates each value but I believe the default is a comma so you should be ok with just this. Otherwise the format is:<BR><BR>arr = Split(strSubmitted, ",")

  3. #3
    Join Date
    Dec 1969

    Default RE: Saving into an array from a FORM

    From the VBScript docs on the Split function:<BR><BR>delimiter: Optional. String character used to identify substring limits. If omitted, the space character (" ") is assumed to be the delimiter. If delimiter is a zero-length string, a single-element array containing the entire expression string is returned. <BR><BR>So you *need* to use Split( Request.Form("multiSelectField"), "," )<BR><BR>But caution: If any of the values in that multiselect field THEMSELVES contain commas, then the split will *not* do what you want! If you have that problem, ask again. It&#039s not hard to work around.<BR><BR>

Posting Permissions

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