vendredi 30 janvier 2015

Quick methods Javascript/Jquery/etc to retrieve all aspnet:textbox (input) contained in a form, excluding other elements


I created a 'test Label' or alert to see values of variables (some way to know values of variables like in Matlab?)


How can I change so i can retrieve the correct number of elements as required (and not value '0' or 'all elements' or 'errors')?


Code is this:



var lenform = document.getElementById("ActionInMoveID").length;
var selform = document.getElementById("ActionInMoveID");

var count = 0;
for (var k = 0; k < lenform; k++)
{
if (selform.elements[k].tagName == "input")
count++;
}
alert(count);


Thanks a lot





Aucun commentaire:

Enregistrer un commentaire