function TimeStamp(t){
var today = new Date();
var oform = document.frmret;
var objEl = oform.elements["Ret_Attempt" + t]
if(objEl.checked){
oform.elements["Ret_Att_Time" + t].value = today;
}
else{
oform.elements["Ret_Att_Time" + t].value = "";
}
}
This code should work, but I haven't tested it at all. It's quite possible
too that you're going have to have to check which index on the Checkbox
was checked because that should be considered a collection.
Chris Tifer
----- Original Message -----
From: "LeGrand Decius" <[EMAIL PROTECTED]>
To: "ActiveServerPages" <[EMAIL PROTECTED]>
Sent: Thursday, November 07, 2002 10:15 AM
Subject: Checkbox Object Array
> I have three check boxes on a page. How can I get the following to work
> without writing 3 different functions.
>
> <input type="checkbox" name="Ret_Attempt1" value="1"
onClick="TimeStamp(1)">
> <input type="checkbox" name="Ret_Attempt2" value="1"
onClick="TimeStamp(2)">
> <input type="checkbox" name="Ret_Attempt3" value="1"
onClick="TimeStamp(3)">
>
> function TimeStamp(t){
> var today = new Date();
> var oform = document.frmret;
> if(oform.Ret_Attempt1.checked)
> oform.Ret_Att_Time1.value = today;
> else oform.Ret_Att_Time1.value = "";
> }
>
>
>
>
> ---
> You are currently subscribed to activeserverpages as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to
%%email.unsub%%
>
---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]