Querystring help needed - Javascript

They have: 46 posts

Joined: Dec 2000

I need to know who to access a querystring in Javascript.

In asp I would do something like:

Request.Querystring("string")

But how is it done in Javascript?

Also, I have a form and what I am trying to do is to send the user to another page when the submit button is pressed. I am using a script to validate the form, but when I add something like window.location='this.html' nothing happens. I have also tryed adding window.location='this.html' to the onsubmit="" after I call the script, but that does nothing as well.

Any ideas on both?

Thank you

_Nathan.

detox's picture

They have: 571 posts

Joined: Feb 2001

How about simply embedding the js validation on the page you want the for to go to. Have an error check function at the top of the page to ensure the wrong info doesn;t get passed? Alternatively add your location change to an onclick handler on the submit button. Detriment of this would be you have two streams open.....

with regards to the querystring, try this http://www.infinitemonkeys.ws/infinitemonkeys/recover.asp?url=/infinitemonkeys/articles/asp/976.asp

try this first though:

<script LANGUAGE="JAVASCRIPT">
>
> var querystring
> querystring="

<?php
=Request.QueryString("whatever")
?>
"
>
></script>

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.