I'm trying to come up with a script to do the following:
if checkfield.rawValue = "1" (checked)
timefield.rawValue = (current time)
if checkfield.rawValue = "0" (unchecked)
timefield.rawValue = "null"
Any ideas or suggestions would be greatly appreciated.
Thanks.
Solved! Go to Solution.
Views
Replies
Total Likes
here is a modified version. The BBS display of the script added extra chars that messed things up. I moved the code to the change event of the checkbox (I think it is nicer whne the user clicks to see the change as opposed to exiting the checkbox field). Th e validate message was coming up because you had a pattern on the field and the resulting time does not match that. I removed the pattern as well as turn off the validation script message.
Paul
Views
Replies
Total Likes
This FormCalc code will do what you ask:
if
(checkfield.rawValue == 1) then
timefield.rawValue
= Num2Time(time())
else
timefield.rawValue
= ""
endif
Paul
I'm getting an error with that script.
"Error: Accessor "checkfield.rawValue" is unknown."
This error happens upon opening the form.
The FormCalc script is placed as an exit event on the checkfield.
I have a series of check boxes with a corresponding series of time fields. Each time a check box is checked ( == "1" ), I need the corresponding time field to calculate the current time (thus logging the time each box is checked).
Any ideas?
Thanks.
Views
Replies
Total Likes
Its easier to debug if I can see the form...can you post it?
Paul
Views
Replies
Total Likes
I've copied the check and time fields onto a new form (as an example) and have placed the FormCalc script on the first checkbox only.
A different error is occurring now. The script appears to be working, but every time I check the box a warning comes up stating the time field failed to validate.
Thanks for your assistance with this. It is greatly appreciated.
Views
Replies
Total Likes
here is a modified version. The BBS display of the script added extra chars that messed things up. I moved the code to the change event of the checkbox (I think it is nicer whne the user clicks to see the change as opposed to exiting the checkbox field). Th e validate message was coming up because you had a pattern on the field and the resulting time does not match that. I removed the pattern as well as turn off the validation script message.
Paul
Views
Replies
Total Likes
Many thanks Paul.
Once again your assistance has been invaluable.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies