If the form fails client-side validation, it never submits.
When it
submits, it will submit to a destination -
<form action="destination"...
That destination can be the form page itself, or it can be a
form processing
script on another page. That's where the server side
validation kicks in.
For example, if the form submits to itself, you put some
scripting in the
head of that page that tests to see if the form has been
submitted, e.g., in
PHP that would be -
if(isset($_POST)) {
server validation goes here
}
If the form is submitting to another page, then obviously,
you don't have to
do this check.
Make sense?
One good reason why you'd want the form to submit to itself,
would be If it
fails the server scripted validation, then you would just let
the form
re-draw, but populate the fields with the data contained in
the $_POST
array, so that the user could make corrections more easily.
Of course, you
can set a variable describing the error(s) this way, and
display them on the
page as well.
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"patricktr" <webforumsuser@macromedia.com> wrote in
message
news:fr6v4g$3ce$1@forums.macromedia.com...
> Hi Murray,
>
> I've been playing around with this to try and make sense
of it so maybe I
> took
> it off the 'onsubmit' and put it on the 'onclick' - the
point is how when
> you've told it to validate at client level with the
javascript do you then
> tell
> it to validate at the server level?
>
> I'm obviously not making myself clear or it's so
blindingly obvious you
> can't
> understand what my problem is but I'll try again...
>
> Somehow or other when the javascript finishes the system
knows there are
> problems and display a pop-up and forces us back around
the form loop
> again.
>
> I can add in extra php code (if $_POST(SUBMIT...) that
will do more
> rigourous
> validation at the server level (db checks etc) but how
can I get it to
> loop
> back around and re-present itself? If I use 'header
)location ... ' I
> can't
> seem to find a place where it happy to be re-directed -
there is header
> info
> in a non-editable place brought on from a template (I
didn't say that
> befpore I
> must admit) ....
>
> I'm sure this should be easy but .....
>
> P.
>
>
>