By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,286 Members | 2,364 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,286 IT Pros & Developers. It's quick & easy.

How to disable php script messages using javascript??

P: n/a
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

Feb 4 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
Feb 4 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.