how to make a terms and conditions field with checkbox validation

how to make a terms and conditions field. with a checkbox which need to be checked in order to save data? is there any tutorial or sample?

add a custom field of type checkbox and set checked value, i.e. ‘Y’.

in the onvalidate event perform a test to check the checked value and fail if not. Codesnippet is copied by clicking the green dot on the right for the errorexit sample.

Thank you very much Albert! It works. You are genius!