Open YanBlochSergata opened 9 years ago
+1
Hey all!
We've just found that the input that the directive renders has no name attribute, and while this the form validation throws error since can't validate the value of the ui-select.
Did anyone worked out this? Thanks,
Can you elaborate on what sort of validation you're trying to accomplish? Sample code as well? thanks.
@MBentley1976 Yeah, we are using Valdr to validate our forms. we tried to not to make rules / constraints on the model which the ui-select using but since ui-select creates an input inside it ( so inside the form ) valdr tries to fetch it and attach its own validation object(s). It dies since the input has no name attribute.
I see. Well, I'm not familiar with Valdr but one workaround you may want to try is to create an extension to the ui-select directive. In that extension you can use jquery; either native or the angular wrapped up version, to sniff out the input and add the name attribute yourself. By using an extension you'll get the functionality "for free" everywhere. Good luck.
Hey all,
I'm trying to add required to my "ui-select multiple" element, but no success so far.
I tried adding "required" to the input that generates from the directive, but the input doesn't recognize the selections, it keeps being invalid.