Multiselect Listboxes + Split() -Challenge

Results 1 to 3 of 3

Thread: Multiselect Listboxes + Split() -Challenge

  1. #1
    Join Date
    Dec 1969

    Default Multiselect Listboxes + Split() -Challenge

    Hi,<BR>I have a MultiSelect text box in a page that has some addresses like "1 A Street", "2 B Street" etc. All unique values.<BR><BR>On Submitting, I am taking those values to the next ASP page. Now I have in hand a comma separated list of addresses.<BR><BR>There I am trying to use Split function to convert this comman separated list into an array of... Yes an array of addresses(Strings).<BR><BR>But the Split function always gives Type Mismatch error. WHy does it behave like that ? Please suggest.<BR><BR>Thank you very much. <BR><BR>RR<BR><BR><BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Multiselect Listboxes + Split() -Challenge

    you may like to check out the article on dual pane administration on<BR><BR>you&#039;ll notice that your &#039;comma separated list&#039; is actually a collection, hence no Split()<BR><BR>j

  3. #3
    Join Date
    Dec 1969

    Default You don't show code, so a guess...

    Atrax is theoretically would likely be better off to treat the multi-valued field as a collection, which means you *already* have array-like access to it:<BR><BR>&#060;%<BR>max = Request.Form("theList").Count<BR>For i = 1 To max<BR>&nbsp; &nbsp; value = Request.Form("theList")(i)<BR>&nbsp; &nbsp; ...<BR>Next<BR>%&#062;<BR><BR>However, you *should* be able to do what you are trying to do.<BR><BR>I would *guess* that the problem is that your code does something like this:<BR><BR>&#060;%<BR>Dim ar() &#039; or maybe ar(5) or whatever<BR>ar = Split( Request.Form("theList"), ", " )<BR>%&#062;<BR><BR>That&#039;s a no-no. Strangely enough, all you want and need is:<BR><BR>&#060;%<BR>Dim ar &#039; no parens, no size!<BR>ar = Split( Request.Form("theList"), ", " )<BR>%&#062;<BR><BR>But you know, all this would be a *LOT* easier for us to help you if you&#039;d just show code. Please? From now on?<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