i have a form with this validation
jquery
$("#aioForm").on('submit',function(e){
var errorCount = 0;
$('span.errorMessage').text('');
// checkign for multiple select [now you have one]
var select = $('#addIO select').filter(function(){
return this.selectedIndex == 0;
}).next('span').text('Please select a cell');
// checking for inputs
var input = $("#aioForm input[type=text]").filter(function() {
return !this.value;
}).next('span').text("fill the name please");
// no error checking
if(input.length==0 && select.length == 0){
$(this)[0].submit(); // submit form if no error
}
e.preventDefault();
});
if there is no error i want to set the url to submit before submit , i mean before the statement
$(this)[0].submit();
You need to use:
Edit: (After OP comments)
If you want to submit your form with some specific values from javascript:
Add two fields in your form like this:
Now in jQuery you need to do this before submit:
Now on server side: