06-07-2017, 07:58 AM (This post was last modified: 06-07-2017, 08:02 AM by gbwebapps.
Edit Reason: Adding CI version
)
Hi there to everyone...
I have a strange problem when I try to validate a select multiple field in a form contained in a bootstrap's modal.
I don't think the problem is due to the modal, but anyway, I go to explain...
The mechanism is developed with ajax technique.
I have a form in which I insert products. I have 4 fields: product, brand, categories and description. (pic 1)
I use to put the rules validation inside the model in this way:
In the view I have this code that receive the errors:
Code:
...........
var data = JSON.parse(data);
if(data.errors) {
$.each(data.errors, function(key, value) {
var element = $('span#' + key);
element.html(value);
})
$('#messages').html(data.messages).fadeIn(100).delay(2000).fadeOut(100);
} else {
............
All this mechanism is working fine, except for the multiple field, I can't display the error....
The strange thing is that if I become the multiple select in simple select (so not an array) and I remove all brackets ([]),
the field display properly the error...
Someone did have a similar problem which he could solve?