| thebitbandit@yahoo.com 2005-03-31, 11:24 pm |
| I'm using Dreamweaver MX (not the 2004 edition) and am building a site
that uses the PHP / mysql Server Model.
I have used the "Record Insertion Form" Application Object to create a
form that inserts records into my mysql database, and it works just
fine.
What I would like to do now is to do some field validation, in PHP,
before trying to insert the record (i.e. field required, valid date,
etc).
I know I can do form validation via JavaScript, and I have implemented
this using the Yaromat Check Form behavior. But I would like to also
do the checks in PHP after the form is submitted. This will let me do
more advanced validation and handles the problem of when users have
JavaScript turned off.
Ideally I'd like to give a nice error message, and maybe even redisplay
the form with all the user entered text filled in and some sort of
indicator next to the invalid field.
I know I can hand-code this in PHP (I'm an old PHP hand-coder from way
back and have only recently started using Dreamweaver's PHP Server
Model). But I'm wary about changing the PHP code made by Dreamweaver
as I assume that if I do this then Dreamweaver may not let me edit the
behavior via it's GUI and may get upset.
Has anyone made a modified Record Insertion / Update behavior that does
what I'm looking for? Or will I have to modify the PHP code created by
Dreamweaver? Or am I best to drop the PHP code created by Dreamweaver
and just hand-code it myself from scratch?
I am interested in knowing how other PHP programmers make use of
Dreamweaver's PHP abilities. Do you find yourself modifying the
generated PHP code, and if so how does Dreamweaver react to this?
|