Reputation: 309
Please I have a little problem, i want to retrieve or set the form attribute found in a variable. The variable contains a form object, for which i suppose I should be able to get for example an input field with the id="cusID". I have tried this but it doesnt seem to do what i want. Any idea what I am missing
var form = $('form[data-validate="true"][id="form"]');
So now if i want to access the elements on the selected form , i do this
var check = ( form +'[id=CusID], '+ form +'[id=email]');
But I get this [object Object][id=CusID], [object Object][id=email]" what am I doing wrong?
Upvotes: 2
Views: 75
Reputation: 15154
try find
:-
var check = $(form).find('[id=CusID],[id=email]');
or:-
$('#CusID, #email');
As id
's must/should be unique.
Upvotes: 2