Hello,
I'm building a website with an input form. The form has a lot of javascript checks, which display errormessages in dynamic html. These checks are performed onblur (for each field) and onsubmit (for the entire form, a function CheckForm is called).
Now, I would like to send the data to a PHP script.
I currently have action="sendmail.php", which directs to an error page and asks the user to press back to return to the form: all the dhtml errormessages are still show.
But, can I avoid the user having to press back by not redirecting to a new page if CheckForm says there are errors?
(If I redirect the user to the form page, the page reloads and the dhtml errormessages are not shown
)
An option might be to have an onload function, which checks the referrer (how can I do this?). If the referrer is the php script: call CheckForm.
Bear in mind that the page is part of a Typo3 CMS, so I'm limited in sending parameters to pages.
Thanks!
Jorg
I'm building a website with an input form. The form has a lot of javascript checks, which display errormessages in dynamic html. These checks are performed onblur (for each field) and onsubmit (for the entire form, a function CheckForm is called).
Now, I would like to send the data to a PHP script.
I currently have action="sendmail.php", which directs to an error page and asks the user to press back to return to the form: all the dhtml errormessages are still show.
But, can I avoid the user having to press back by not redirecting to a new page if CheckForm says there are errors?

(If I redirect the user to the form page, the page reloads and the dhtml errormessages are not shown

An option might be to have an onload function, which checks the referrer (how can I do this?). If the referrer is the php script: call CheckForm.
Bear in mind that the page is part of a Typo3 CMS, so I'm limited in sending parameters to pages.
Thanks!
Jorg
Comment