[thelist] javascript variable issue (continued)

Hassan Schroeder hassan at webtuitive.com
Fri Aug 31 08:00:28 CDT 2001


ALBIE ATTIAS wrote:

> The answers from page2.htm are passed onto page3.htm
> using the query string again.

Nope, they're not - you're assigning the values args[0,1,2] to a
hidden field *as a literal*. Take a look at the query string when
you get to page 3.

So on page 2, instead of

<!-- answers from page 1 -->
 <input type="hidden" name="q1" value="args[0]">
 <input type="hidden" name="q2" value="args[1]">
 <input type="hidden" name="q3" value="args[2]">
 
start the page with 

<!-- answers from page 1 -->
 <input type="hidden" name="q1" value="">
 <input type="hidden" name="q2" value="">
 <input type="hidden" name="q3" value="">

and change your getArgs function to set the values of q[0,1,2] to the
arg value. 

Less important, I'd suggest making the function either void - return 
nothing, since you're not doing anything with the returned object - 
or return a boolean true or false for success/failure if you want to
confirm the arg decode was successful (requires extra code!).

HTH!
-- 
H*
Hassan Schroeder ----------------------------- hassan at webtuitive.com 
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

    -- creating dynamic Web sites and applications since 1994 --




More information about the thelist mailing list