views:

169

answers:

1

Hi all,

I'm trying to figure out if I can do the following:

  1. User submits form to script via jquery post
  2. Depending on what was processed, script may or may not return errors
  3. If the script did not process any errors (i.e. SUCCESS), I want to redirect to a SUCCESS page

I know it's possible to redirect the browser via javascript, but I'm worried if some users have javascript disabled the entire flow might get messed up.

Thanks in advance.

+2  A: 

As you want to evaluate the form (currently) with jQuery, you can safely assume that, when the form is evaluated, JavaScript is available.

For those without JavaScript, you should add some server side routine, that does the job. And then you can use a redirect via HTTP header, or a <meta> redirect.

To keep both ways working, hard code the server side routine into the code, and replace it via jQuery when the page is loaded. JavaScript users will execute the jQuery replacement and get the jQuery evaluation; other's will just stay with the normal version.

poke