Reputation: 1540
I need to implement the following work flow.
What is the best way to achieve this? The url field and the form fields are two diffrent models in one form, cause for saving I need both.
Most of the work flow I already implemented, but I`am not sure if this is the correct way. I enabled the ajax validation for my form. The url field is validated correctly, but the other fields not eveny trigger the validation. Maybe cause those fileds are packed in an bootstrap active form?
After clicking the "validate"-button I trigger an own ajax request, where I validate the url manually. If its valid I parse the page and return all found informations, elsewise I return the errors. The success method than shows the errors or fill the other form fields. Is there a way to trigger the yii ajax validation programmatically before send my own ajax request.
Now I´am stucked with the ajax validation of the other form fields. Submit, validate and save on success works well. But I want a validation without submitting. Do I have to implement my own ajax request and response handling or is there a way to use some yii built-in functionality?
Upvotes: 0
Views: 164
Reputation: 4967
Let's say you have a form with some fields:
It's also a good practise to
And note that
Am I misunderstanding you?
Upvotes: 1