get all values in hidden field with the same name code example
Example: get all values in hidden field with the same name
<input type="hidden" name="customerID" id="customerID1" value="aa190809" />
<input type="hidden" name="customerID" id="customerID2" value="aa190810" />
<input type="hidden" name="customerID" id="customerID3" value="" />
<script>
$("input[name=customerID]").each(function(){
console.log(this.id + " with value: " + this.value);
if (this.value == "") {
this.value = "my new value";
}
});
</script>