How to disable php script messages using javascript??

L

Leszek

Hi

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??

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?

What is the way to solve this problem?

Thanks for help.
Leszek
 
C

Christophe HENRY

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 ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top