views:

517

answers:

3

hi all,

i'm using html , javascript & mod_python

i want to submit html form

i used

document.formName.submit();

after submitting

i want to redirect to new page

--i tried location="newpage.html" NOT working

+1  A: 

Unless you're submitting the form with AJAX then submitting will take the user to a new page, so you can't do a javascript redirect.

You could redirect on the server side, or change the action of the form.

Greg
unfortunately using ajax is not allowed
mahmoud
what do you mean AJAX is not allowed? You clearly are already making javascript a requirement, so I do not see any technical limitation here...
wiifm
this is one of the requirements in the ancient organization :) where i'm working in , team leader will not accept this </script>') at the end of the python function that to be executed while submitthnx all
mahmoud
A: 

Use ajax to submit the form. Then onSuccess callback, set window.location = new_url.

prime_number
unfortunately using ajax is not allowed
mahmoud
A: 

Req.write('location.href="page.py?fn=xxx";')

at the end of the python function that to be executed while submit

thnx all

mahmoud