Steve Piercy - Web Site Builder Re: Form building that differs between add and edit
Oct 01, 2010; 02:58
Steve Piercy - Web Site Builder
Re: Form building that differs between add and edit
That's what I do in the action file. For example, let's say you want to display the date that a Send Off report was submitted by the referee, as well as its arbitrary ID number, to an authenticated administrator. These values cannot change. You may be tempted to use "disabled" to prevent the administrator from changing these values, but that results in the values not getting submitted at all and not appearing if there is a separate validation error. Instead, display the field value allowing the admin to edit the field, but disregard their changes when the form is valid by removing the fields:
Conversely, I user $f->addfield for situations where I need to write the filepath of an uploaded file to the database.
--steve
On 10/1/10 at 11:45 AM, inbox_js@solve.se (Johan Solve) pronounced:
>I think you have to conditionally remove the fields as soon as >you know the formmode. >That way the unwanted fields don't mess with validation. > >At 18.55 +1000 2010-10-01, list@carlestam.com wrote: >>I have a semi complex form that have more sections to handle on an add than on an >edit. >> >>In the library and content pages I can easily handle that by looking for >>$fForm -> formmode == 'edit' >> >>But how can I differentiate on the config page? So that I don't include the form >fields that are only relevant on an add. >> >>Especially the required fields muck things up since they trigger the form to not >validate when saving. >> >>HDB >>Jolle >> >>-- >>############################################################# >>This message is sent to you because you are subscribed to >>the mailing list <knop@lists.montania.se>. >>To unsubscribe, E-mail to: <knop-off@lists.montania.se> >>Send administrative queries to <knop-request@lists.montania.se> >>List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html >>Project homepage http://montania.se/projects/knop/ >>Google Code has the latest downloads at http://code.google.com/p/knop/ > > >-- >Johan Slve [FSA Member, Lasso Partner] >Web Application/Lasso/FileMaker Developer >MONTANIA SOFTWARE & SOLUTIONS >http://www.montania.se mailto:joh-n@montania.se >(spam-safe email address, replace '-' with 'a') >
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Steve Piercy Web Site Builder Soquel, CA <web@StevePiercy.com> <http://www.StevePiercy.com/>
-- ############################################################# This message is sent to you because you are subscribed to the mailing list <knop@lists.montania.se>. To unsubscribe, E-mail to: <knop-off@lists.montania.se> Send administrative queries to <knop-request@lists.montania.se> List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html Project homepage http://montania.se/projects/knop/ Google Code has the latest downloads at http://code.google.com/p/knop/
Oct 01
Steve Piercy - Web Site Builder Re: Form building that differs between add and edit
Oct 01, 2010; 04:05
Steve Piercy - Web Site Builder
Re: Form building that differs between add and edit
Oct 01
Jason Huck Re: Form building that differs between add and edit
Oct 01, 2010; 06:37
Jason Huck
Re: Form building that differs between add and edit
Oct 01
Ric Lewis Re: Form building that differs between add and edit
Oct 01, 2010; 10:27
Ric Lewis
Re: Form building that differs between add and edit
Oct 01
Johan Solve Re: Form building that differs between add and edit
Oct 01, 2010; 11:45
Johan Solve
Re: Form building that differs between add and edit
Oct 01
Steve Piercy - Web Site Builder Re: Form building that differs between add and edit
Oct 01, 2010; 16:58
Steve Piercy - Web Site Builder
Re: Form building that differs between add and edit
Oct 01
list Form building that differs between add and edit
Oct 01, 2010; 18:55
list
Form building that differs between add and edit
Oct 01
Steve Piercy - Web Site Builder Re: Form building that differs between add and edit
Oct 01, 2010; 21:23
Steve Piercy - Web Site Builder
Re: Form building that differs between add and edit
Oct 02
list Re: Form building that differs between add and edit
Oct 02, 2010; 09:29
list
Re: Form building that differs between add and edit
Oct 02
list Re: Form building that differs between add and edit
Oct 02, 2010; 10:11
list
Re: Form building that differs between add and edit
Oct 02
list Re: Form building that differs between add and edit
Oct 02, 2010; 17:43
list
Re: Form building that differs between add and edit
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!