Le Sat, 04 Feb 2006 05:37:10 +0100, Leszek a écrit :
I have user-side javascript that validates a form. And I have server-side
php script thad does the same. Is it possible to disable php script from
showing messages about missing values if javascrpt did it before??
The javascript checks the user's error, right? It's up to it not to call
the page if there's an error. You could, in the submit event, tell the
javascript to not call the php page. Otherwise, you could set up a boolean
parameter in the form, such as a hidden field, where the php could find
wether the form is good or not.
i have <div id='wrong"></div> that contains these messages. So I
tried to set style.display='none' but it seems that it doesn't work. I
guess this is because javascript first sets style.display='none' but it
has no effect on php script that just write messages... Am I right?
The php server-side code processes the page before sending it. I can
suppose that as soon as the php got the page, it means that the page is
good. Why such a need, then?
What is the way to solve this problem?
- Think carefully about the interaction between JS and PHP.
- Keep on writing on usenet ;-)
--
Christophe HENRY
fo***************@nerim.net (sans lkm)
GnuPG : 3922239E60036EC86BF7268A877C52AC 4883C02A