'How return two or more elements in front of .push($(this).val());?
I have a function that submits information to create a prerequisite on my database. Information "templates" and "version" are on the same checkbox (look the picture for understand) and with my code, i want to get the id_template and the version but I just have the id_template. What can replace push($(this).val()) to get these two elements?
var templates = [];
console.log(templates);
console.log($(this));
if(mode == 'create') {
if( $('.selectTemplateRow:checked').length > 0 ){
$('.selectTemplateRow:checked').each(function(){
templates.push($(this).val());
});
}
}
var project_name = $('#project_name').val();
var sharepointLink = $('#sharepointLink').val();
var data = { _token: CSRF_TOKEN, project_name : project_name, id_user : id_user[0], id_template :id_template, id_template : id_template, version :version, sharepointLink : sharepointLink};
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
