|
Posted by Janwillem Borleffs on 11/05/05 15:50
Joker7 wrote:
> Question is the away to do what the Java Script below is doing but in
> PHP as I don't like using Java Script if I can help it.
> I need a way to count and show the user of the form how many
> characters are left.
>
JavaScript = (most of the cases) client side & PHP = server side;
The stuff you are doing with JavaScript can only be done by PHP by sending
regular calls to the server, where PHP validates the input. These calls need
to be triggered by JavaScript, so apart from the fact that the server will
be called frequently, this solution will not be very practical.
The best thing you can do is put both the JavaScript and server side PHP
validation in place. When JavaScript is enabled on the client, it does its
stuff and the PHP script on the server will complement the validation.
JW
Navigation:
[Reply to this message]
|