If we do not do this the user will have to complete the entire form again.
??? ??? ???
Customizing the Page
[ 246 ]
We may choose to miss out the Pass invalid input to user session process, as the
core components do. It is normal to include JavaScript to validate forms before they
are submitted, and since the majority of users will have JavaScript support, it would
be relatively safe to assume that such an occurrence would be very unlikely.
Note that missing out this process is not the same as missing out form validation. We
must never depend on JavaScript or other client-side mechanisms for data validation.
It is best to start developing forms without the bells and whistles of client-side
validation so as to ensure that we properly handle invalid data if the server-side
scripts ever need to deal with it.
As a quick aside, a good way to validate form contents is to use a JTable subclass
check() method.
If we place failed input into the session, we might want to put it in its own
namespace. This makes it easier to remove the data later and helps prevent naming
conflicts.
Pages:
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339