hi,
on my page is a list of items a user can choose
by way of tick boxes.
when someone ticks a box i would like the number of hours available to them to deacrease by the hours next to the tick box item.
am new to javascript - do i need to put values in hidden
form elements to send to the function?
i get 'this object dosnt support this property' error
function
html
on my page is a list of items a user can choose
by way of tick boxes.
when someone ticks a box i would like the number of hours available to them to deacrease by the hours next to the tick box item.
am new to javascript - do i need to put values in hidden
form elements to send to the function?
i get 'this object dosnt support this property' error
function
Code:
function hoursleft() {
var hoursleft = document.forms["custaddwork"].elements["hoursleft"].value;
var hours = document.forms["custaddwork"].elements["hours"].value;
document.forms["custaddwork"].elements["hourslefttot"].value = hoursleft - hours;
}
html
Code:
<tr>
<td class="usersml" bgcolor="#000000"> <div align="center">
<input type="text" name="hourslefttot" value="<%=x_hoursleft%>">
</div></td>
</tr>
<%Do Until rs.eof
' Load Key for record
x_stdworkid = rs("stdworkid")
x_stdworklinkid = rs("stdworklinkid")
x_stdwork = rs("stdwork")
x_stdtime = rs("stdtime")
x_stdworktypeid = rs("stdworktypeid")
%>
<tr>
<td width="217" bgcolor="#F5F5F5"><span class="mfitsml"><%=x_stdwork%></span></td>
<td width="88" bgcolor="#F5F5F5"><div align="right"><span class="mfitsml"><%=x_stdtime%>hours</span><input type="text" name="hours" value="<%=x_stdtime%>"></div></td>
<td width="75" bgcolor="#F5F5F5"><div align="center"><span class="mfitsml">
<%
'standard work check box tick
if x_stdworklinkid <> 0 then
check="Checked"
else
check="Unchecked"
end if
%>
<input type="checkbox" name="chkboxstd" value="<%=x_stdworkid%>" <%=check%> onChange="hoursleft();"/>
</span></div>
</td>
</tr>
<%
rs.MoveNext
rowcount = rowcount + 1
Loop
%>