Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 10th, 2004, 11:18 PM
Authorized User
 
Join Date: Apr 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to pigtail Send a message via Yahoo to pigtail
Default IndexOf doesn't work on QueryString field?

I tried to pass the variable mylist from Script#1 to Script#2. I couldn't use the indexOf operation on this variable in Script#2. Is it not a string after it's passed to Script#2?

Script#1:
var shoelist = "abc, efg, hijkl, mnop";
shoePhone.src = "newrec.asp?mylist=" + shoelist ;

Script#2:
var mylist= Request.QueryString("mylist");
var isrch = mylist.indexOf(",");


 
Old April 11th, 2004, 11:26 PM
Authorized User
 
Join Date: Apr 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to pigtail Send a message via Yahoo to pigtail
Default

I have figured it out. Thanks.

 
Old April 14th, 2004, 12:39 PM
Authorized User
 
Join Date: Apr 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to pigtail Send a message via Yahoo to pigtail
Default

If the string that the QueryString returns is consist of "value1, value2, value3", you must reconstruct this string into "value1,value2,value3" format before you can use the IndexOf operation on this new string in your page.






Similar Threads
Thread Thread Starter Forum Replies Last Post
using querystring melkin Classic ASP Basics 7 April 1st, 2008 09:07 AM
Querystring or not? myself Classic ASP Basics 4 July 4th, 2006 09:01 AM
C# String.IndexOf matching at the beginning. Chandra Paladugu C# 2 March 17th, 2006 05:49 PM
indexOf crmpicco Javascript How-To 1 September 30th, 2005 09:02 PM
Formatting Querystring Field Name realgone_ VBScript 4 September 23rd, 2004 07:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.