[ic] required field checking and profiles driving me nuts!

Joshua Rusch interchange-users@icdevgroup.org
Wed May 21 21:23:01 2003


> I have been spending hours trying to get the account_change profile to
> actually do anything about required fields on the account.html page.
It
> didn't work, right from the beginning on a fresh install (I've tried
on
> both 4.8.7 and  4.9.7).  Its possible to clear out all the fields and
> submit a completely blank form which saves the empty values to the
userdb.

Use mv_form_profile instead of mv_order_profile.
Order profiles only kick in with submit buttons, which are only used for
submitting orders (look into &final if you want to submit an order
without finalizing it). It is important to note that form profiles kick
in at the beginning of form processing, before anything else (ie
mv_clicks) happen.
Also, since the form profile happens at the beginning, if the form check
fails, the fields won't be updated, and the page will load again with
the previous values in the form. What I did was put an [update values]
at the beginning of the content area, and then added an extra error
message saying "your changes have not been saved yet".

BTW, if you know a little perl, I highly recommend reading through
do_process in Dispatch.pm. Best piece of advice I found in the archives
:) I didn't fully grasp form processing for interchange until I spent a
little time reading the perl.

Josh