php - Jquery check multiple Selects have value set -
I have a form with a number of selected areas, so you can select several entries per selection.
Each selection has been named While trying to submit with Jquery, can I check the form whether there is no selection in any selection? I have tried to do this, but the form is still present. I do not need to know There is no option to select which specific 'id', but if it did I would have been good .. thanks You can use the function to return all the selections, which are any values Not selected Then you can check to see if you have no value - and you have access to those elements too Since then you have to submit the form handler to Bind so that instead of a click of a button So if you want to stop the form you can do this If any selection is selected with a value then false return will be id1 [] ,
id2 [] ,
id3 [] etc.
$ ("$ submit" (. ($ (This) .val () == ""). Click (function () {$ ("[name = = 'id' ]: Select "visible"). Each (function (index, element) {if ($ (this) description is false;});});
var withNoValue = $ ("select [name = = 'id']: visible"). Filter (function () {return! This.value.length;} );
if (Also select. Length) {// if selected with a value, // something to do}
return! Select withNoValue.length
Comments
Post a Comment