Adding fields to form after submission

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding fields to form after submission

Jolle Carlestam-2
In the example project there's two ways of handling a form object  
after submission. The "easy way" using $f -> (process: -user=
$activeUserName);

and the "the more complicated way" using

$f -> loadfields;

var: 'updatefields'=$f -> updatefields;

$d -> (saverecord: -fields=$updatefields,
                        -lockvalue=($f -> lockvalue),
                        -user=$activeUserName);

Using the complicated way I can insert other fields and values by  
inserting them as pairs to $updatefields. But is there some trick to  
do the same using the easy way?

This is for populating fields like created_org, created date etc.  
Fields that I don't want displayed in the html form even as hidden  
fields.

HDB
Jolle

#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://lists.montania.se/Lists/knop/
(log in with your email and ConfirmationID as password, send message to
<[hidden email]> to get that ID)
Project homepage http://montania.se/projects/knop/
AIM chatroom knop aim:gochat?roomname=knop


Reply | Threaded
Open this post in threaded view
|

Re: Adding fields to form after submission

Johan Solve-2
At 09.43 +0200 2007-05-30, Jolle Carlestam wrote:
>Using the complicated way I can insert other fields and values by inserting them as pairs to $updatefields. But is there some trick to do the same using the easy way?

You can't add fields with hard coded values to the form object right before calling ->process as it will perform ->loadfields which will override the default values for those fields.

I think you're out of luck with this. ->process is a black box.


I can see to ways to implement support for this.

The first is to add a new special field type to the form object, let's say "data".
That field type will not interact with forms and will never be touched by loadfields, but it will populate ->updatefields. Maybe that can be useful also for other purposes.

The second way would be to be able to pass a pair array to ->process that will be merged with the ->updatefields pair array. Not a very attractive solution.

--
     Johan Sölve    [FSA Member, Lasso Partner]
     Web Application/Lasso/FileMaker Developer
     MONTANIA SOFTWARE & SOLUTIONS
http://www.montania.se   mailto:[hidden email]
 (spam-safe email address, replace '-' with 'a')

#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://lists.montania.se/Lists/knop/
(log in with your email and ConfirmationID as password, send message to
<[hidden email]> to get that ID)
Project homepage http://montania.se/projects/knop/
AIM chatroom knop aim:gochat?roomname=knop

Reply | Threaded
Open this post in threaded view
|

Re: Adding fields to form after submission

Jolle Carlestam-2
30 maj 2007 kl. 09.58 skrev Johan Solve:

> At 09.43 +0200 2007-05-30, Jolle Carlestam wrote:
>> Using the complicated way I can insert other fields and values by  
>> inserting them as pairs to $updatefields. But is there some trick  
>> to do the same using the easy way?
>
> You can't add fields with hard coded values to the form object  
> right before calling ->process as it will perform ->loadfields  
> which will override the default values for those fields.
>
> I think you're out of luck with this. ->process is a black box.

No problem I can use the complicated way.

>
>
> I can see to ways to implement support for this.
>
> The first is to add a new special field type to the form object,  
> let's say "data".
> That field type will not interact with forms and will never be  
> touched by loadfields, but it will populate ->updatefields. Maybe  
> that can be useful also for other purposes.

Sounds like a good idea.


HDB
Jolle

#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://lists.montania.se/Lists/knop/
(log in with your email and ConfirmationID as password, send message to
<[hidden email]> to get that ID)
Project homepage http://montania.se/projects/knop/
AIM chatroom knop aim:gochat?roomname=knop