help with passing variables

Results 1 to 3 of 3

Thread: help with passing variables

  1. #1
    Caroline Wise Guest

    Default help with passing variables

    I&#039m not terribly versed with using Jscript/ASP, so please forgive my newbieness. I&#039m passing the variable id_list from one page to another with a method=post, this variable looks like this:<BR><BR>"a","b"<BR><BR>the idea is that I want to insert this into a line on the second page that looks like this:<BR><BR>var stuff = new Array(id_list);<BR><BR>The problem lies in how I get the variable out of the query string. I tried this:<BR><BR>var id_list = Request("id_list");<BR><BR>And even though it looks like a string it doesn&#039t behave like one. I can create the array if I declare id_list = &#039"a","b"&#039, but not with Request(). What do I have to do?<BR><BR>Thanks so much for your help...<BR><BR>Caroline

  2. #2
    Join Date
    Dec 1969

    Default RE: help with passing variables

    I had this trouble a while back and no-one knew what to do with it, so i solved it myself (eventually)<BR><BR>here we go :<BR><BR>var id_list = new Array(Request("id_list"));<BR><BR>though you may have to pass it as a string, which will entail<BR><BR>var id_list = new String(Request("id_list"));<BR>var id_listArray = id_list.slplit(&#039,&#039);<BR><BR>Jason

  3. #3
    Join Date
    Dec 1969

    Default RE: help with passing variables

    Thanks, that&#039s a great way to solve it...<BR><BR>Actually I&#039ve come up with another way to force the variable to become a string (duh!):<BR><BR>var id_list = &#039&#039 + Request("id_list");<BR><BR>Can&#039t believe how quick you answered!<BR><BR>Thanks very much,<BR>Caroline

Posting Permissions

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