Welcome Guest, Not a member yet? Register   Sign In
DataMapper, Validation, Crud issues
#7

[eluser]whoisinkus[/eluser]
[quote author="freshfutures" date="1310442640"]Hi,
1) I'm trying to display form validation errors when a form has been submitted. The validation is done in the model, however I'm not getting proper error strings like 'Name' is a required field, instead I get just 'required'.
[/quote]

I found that the datamapper_lang file lacked a 'required' entry, I added one like this on line 16:

Code:
$lang['required']    = 'The %s field is required.';

And that resolved the 'required' validation issue.

[quote author="freshfutures" date="1310442640"]Hi,
2) I’m stumped as to how I can repopulate the form fields a user has filled in when the page is reloaded after validation fails.
[/quote]

I've found that just using the form_value() function still works while using Datamapper validation. Are you getting different results?

The site I'm working on is using CI 1.7 and I realize you're using 2, so perhaps that has something to do w/ it, but thought I throw that out there and see if it got you anywhere.


Messages In This Thread
DataMapper, Validation, Crud issues - by El Forum - 07-11-2011, 04:50 PM
DataMapper, Validation, Crud issues - by El Forum - 07-11-2011, 11:54 PM
DataMapper, Validation, Crud issues - by El Forum - 07-12-2011, 03:07 AM
DataMapper, Validation, Crud issues - by El Forum - 07-12-2011, 04:37 AM
DataMapper, Validation, Crud issues - by El Forum - 07-12-2011, 06:28 AM
DataMapper, Validation, Crud issues - by El Forum - 07-12-2011, 09:33 AM
DataMapper, Validation, Crud issues - by El Forum - 07-23-2011, 04:48 PM
DataMapper, Validation, Crud issues - by El Forum - 07-24-2011, 03:01 AM
DataMapper, Validation, Crud issues - by El Forum - 07-29-2011, 06:46 PM
DataMapper, Validation, Crud issues - by El Forum - 07-30-2011, 02:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB