Prev | Current Page 754 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

A select element, for example, only permits to choose from a
limited set of values; introducing errors is quite unfeasible. What happens if your system must receive an
input from the user that must be an arbitrary number? Having a select with every possible number is
very unlikely. The way provided by the HTML syntax is to use an input element of type text . However,
what guarantees that the input value is effectively a number? Well, nothing. That is why the server
should always adopt some validation mechanism and provide a suitable answer to the clients that have
tried to submit an invalid set of data. JavaScript can enhance the user experience a lot in the area of form
interactions. Providing client - side validation is a sure way to give to the user a faster and better feedback.
Remember that the client validation can never replace the server validation. Client validation is a mean
to give a better feedback to the user and not a way to protect your system from abuses; there are many
ways to send data to a server skipping the client - side verification, disabling the JavaScript support is
probably the most simple.


Pages:
742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766