I'm having a heck of a time getting this script to work.
I have a "contacts list" dynamically generated from MySQL db via php, which incldes a text field named contact_cycle.
The number of rows returned may be as many as 100, and the contact_cycle.value will vary from row to row.
I'm trying to establish a script that (upon clicking a mass_update button) will add "1" to the value of each contact_cycle field, for all records where a corrisponding checkbox (name= "mass[]") is checked.
The following is a pared-down version of the list by which to test/develop script. Am I barking up the wrong tree here????

I have a "contacts list" dynamically generated from MySQL db via php, which incldes a text field named contact_cycle.
The number of rows returned may be as many as 100, and the contact_cycle.value will vary from row to row.
I'm trying to establish a script that (upon clicking a mass_update button) will add "1" to the value of each contact_cycle field, for all records where a corrisponding checkbox (name= "mass[]") is checked.
The following is a pared-down version of the list by which to test/develop script. Am I barking up the wrong tree here????
<script type="text/javascript">
var contact_cycle = document.getElementsByName("contact_cycle");
var add_one = document.getElementsByName("add_one");
var T1 = document.getElementsByName("T1");
function update_cycle(){
////var test alerts do work ///////
//if (add_one.value !==""){alert("hooray!");}
//if (contact_cycle.value !==""){alert("hooray!");}
/// TEST T1.value doesn not work???///////
//T1.value = add_one.value;}
Number(add_one.value) == Number(contact_cycle.value)+1;
}
</script>
<table>
<tr>
<td scope="col"><input type='checkbox' name='massall' value=''
onclick='checkAll(document.MassUpdate, "mass[]", this.checked)'></td>
<td scope="col"><slot>Cycle </slot></td>
</tr>
<tr>
<td><input type='checkbox' name='mass[]'></td>
<td><input type="text" name="contact_cycle" size="1" value="5"></td>
</tr>
<tr>
<td><input type='checkbox'name='mass[]'></td>
<td><input type="text" name="contact_cycle" size="1" value="2"></td>
</tr>
</table>
<br>
<input type='button' name='Update' value='Cycle' onclick="update_cycle()">
Cycle
<input type="text" size="1" id="mass_cycle" name="add_one" value="0">
TEST
<input type="text" size="1" name="T1" value="0">
var contact_cycle = document.getElementsByName("contact_cycle");
var add_one = document.getElementsByName("add_one");
var T1 = document.getElementsByName("T1");
function update_cycle(){
////var test alerts do work ///////
//if (add_one.value !==""){alert("hooray!");}
//if (contact_cycle.value !==""){alert("hooray!");}
/// TEST T1.value doesn not work???///////
//T1.value = add_one.value;}
Number(add_one.value) == Number(contact_cycle.value)+1;
}
</script>
<table>
<tr>
<td scope="col"><input type='checkbox' name='massall' value=''
onclick='checkAll(document.MassUpdate, "mass[]", this.checked)'></td>
<td scope="col"><slot>Cycle </slot></td>
</tr>
<tr>
<td><input type='checkbox' name='mass[]'></td>
<td><input type="text" name="contact_cycle" size="1" value="5"></td>
</tr>
<tr>
<td><input type='checkbox'name='mass[]'></td>
<td><input type="text" name="contact_cycle" size="1" value="2"></td>
</tr>
</table>
<br>
<input type='button' name='Update' value='Cycle' onclick="update_cycle()">
Cycle
<input type="text" size="1" id="mass_cycle" name="add_one" value="0">
TEST
<input type="text" size="1" name="T1" value="0">
Comment