-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List validation #483
Comments
Use master if possible master has support for it, it was added here #414 |
It works only if use form.validate() and it return but if i use form.commit() it validate only main form and return error related this I have a list of phone numbers but all not have unique id. i think it should add backbone view id and errors should return like this [{"number_view1": "can not be blank"}, {"number_view2": "can not be blank"}] and add this error to own number Also all list have id like undefined_number |
Can you give an example ? Im pretty sure i fixed that issue too |
Can you give that change a go ? Seems to work for me locally (change the tests index.php to use the dev version) |
yes, it work now https://jsfiddle.net/bohdansemenets/j4frtfw9/ |
The fix for that is in src/field.js The fiddle doesnt include that in. It was ok when i was testing |
I'm very confused as to what files I have to take and how to make it work? |
Yeah sorry about that. I can't compile the main file for the pull because it will create conflicts when merging. You may be able to include the SRC/field.js in with your fiddle. Not 100% sure I'll upload how I was testing later today |
clone the codebase, and put this in the tests folder Its your jsfiddle with the code change here I cant add to the fiddle for some reason. |
http://pastebin.com/24L8CZsy backbone forms min http://pastebin.com/uUvniwAC list min Hope that helps |
i put your code to test folder and it not working http://i.imgur.com/30fCPn5.png then i replaced /extra/list on and now it began to work, but not quite right, instead of the actual error message We can see the same messages |
@exussum12 Hi, I can't find a contact email for you, wanted to ask if you were interested in becoming a project admin as I don't have time to maintain this project any more. |
Thats how I see it. @powmedia possibly, Ill email you - are you still using the email from your commits ? |
@exussum12 yep
|
Replied to your email. Let me know if you received it |
On yours screenshot you use ? http://pastebin.com/24L8CZsy backbone forms min http://pastebin.com/uUvniwAC list min |
I'll post the code I was using. What browser and is are you using ? |
Firefox 43.0 |
jsfiddle seemed to work today, Added an example there https://jsfiddle.net/zogkbnwe/2/ Can you confirm that works and then Ill work on the tests |
yes, that works |
what about support hidden id field, after submit form, it should ignore blank id fields, is it possible? |
This doesnt change the current behaviour for hidden forms ? |
In documentation not have information about this. it is very inconvenient, I think the form must take id and transmit the it if it is present |
Solve list validated nested models #483
How i can run validation by nested model schema?
schema: {
firstName: { type: 'Text', validators: [{ type: 'required', message: 'Can not be blank' }] },
phoneNumbers: {
type: 'List', itemType: 'NestedModel', model: infocus.PhoneNumber, title: ''
}
}
schema: {
type: { type: 'Select', options: ['SIP', 'Phone', 'H123'] },
number: { type: 'Text', validators: [{ type: 'required', message: 'Can not be blank' }, { type: 'email', message: 'Invalid number' }] }
}
but when i run form.commit() it validate only main model
The text was updated successfully, but these errors were encountered: