I am having a horrible time trying to figure out what is wrong with my code...
I have a page where a voter (who has 10 votes) can place from 1 to 10 votes for each project - 27 projects in all.
I have figured out how to do batch updates to the database from an ASP page but can't get the Javascript to do it's bit.
Here is the Javascript:
Here is the VBScript:
When I pass the data onto the Confirm page (where I would do the batch update from) I am getting nothing.
The URL (I'm using GET so I can see what is being passed) has values for VotesToDate, NewVotes and pkBudgetItem but NOT for Votes.
It works when I just use a single record on the page so I feel the problem is that it isn't working with the repeat rows but I don't know....
Any help would be greatly appreciated!!!
TIA, Brenda
I have a page where a voter (who has 10 votes) can place from 1 to 10 votes for each project - 27 projects in all.
I have figured out how to do batch updates to the database from an ASP page but can't get the Javascript to do it's bit.
Here is the Javascript:
Code:
function doCalcVote() { //calculates total votes
var input1 = parseInt(document.all.VotesToDate.value);
var input2 = parseInt(document.all.NewVotes.value);
var myTotal = parseInt(input1 + input2);
document.all.Votes.value = myTotal;
}
Code:
<form action="TestConfirm.asp" method="Get" name="form1">
<p>
<input type="submit" name="Submit" value="Vote">
</p>
<table width="50%" border="2" cellspacing="2" cellpadding="2">
<tr>
<td>CHU</td>
<td>Total Votes </td>
<td>New Votes </td>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT rsCHUVotes.EOF))
%>
<tr>
<td><input name="pkBudgetItem" type="text" id="pkBudgetItem" value="<%=(rsCHUVotes.Fields.Item("pkBudgetItem").Value)%>"></td>
<td><input name="VotesToDate" type="hidden" value="<%=(rsCHUVotes.Fields.Item("Votes").Value)%>"></td>
<td>
<input name="NewVotes" type="text" id="NewVotes" onChange="doCalcVote()" value="0" ><input name="Votes" type="hidden" value="">
</td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsCHUVotes.MoveNext()
Wend
%>
</table>
</form>
When I pass the data onto the Confirm page (where I would do the batch update from) I am getting nothing.
The URL (I'm using GET so I can see what is being passed) has values for VotesToDate, NewVotes and pkBudgetItem but NOT for Votes.
It works when I just use a single record on the page so I feel the problem is that it isn't working with the repeat rows but I don't know....
Any help would be greatly appreciated!!!
TIA, Brenda