1955 Posts in 1234 Topics by 601 members
|Go to End|
2 April 2012 at 7:33pm
As per the thread subject heading, I've been studying the back-end code structure that makes how user defined form is crafted and I want to know the module is capable to handle data lookup function when entering the form's fields.
For eg, the application I'm trying to develop is online projects application form to be submitted by our online volunteer members.
I have the form with the following fields.
When a volunteer member enters a form with his membership id, I want the form to process the data lookup on his form and determine if this membership ID is valid. If the membership ID is found, then message onscreen will confirm the member that the membership id is found thus 'First Name', 'Last Name', and 'Email' fields data are retrieved on the form.
I'm wondering would the user defined form module cater that functionality or do I need to extend that functionality in the user defined form?
Hope that makes sense.
5 April 2012 at 11:07pm Last edited: 5 April 2012 11:08pm
I would approach this by creating a custom form field. UDF will automatically pick up any subclasses of EditableFormField so you can write you own (incl validation) rather easily.
The best examples are to look at the inbuilt EditableFormField sub classes. Here's a basic example of one I wrote for a module - https://github.com/willrossi/silverstripe-googlemapselectionfield/blob/master/code/EditableGoogleMapSelectableField.php.
EditableMemberListField (https://github.com/silverstripe/silverstripe-userforms/blob/master/code/editor/EditableMemberListField.php) does something *similar* with regards to the look up
10 April 2012 at 10:15am
Thanks for that.
I tried the links - but they don't appear to be working?
10 April 2012 at 11:00am
Look like the website was out of order momentarily...
All good now.
|Go to Top|