Avatar

Level 2

I have a form with several fields to which users (employees) need to enter their working hours. The grand total (a read only field) must be 40. I relied on FormClac to enter the SUM function.

I want to prevent users from submitting the form if the total is less or more than 40 but I do not want them to constantly get an error message (while filling out the form) if the grand total is not 40. I want the error message to appear only if they try to submit the form and to prevent them from sending the form if the grand total is not 40.

I do not really know much about JavaScript so I would really appreciate it if someone could send me an example.

Thanks,

Yaniv