Image

JavaScript validation

I have a form with 2 input boxes, lets call them debit and credit.

When the form is submitted, I want to call a function that checks that there is either a debit amount filled in OR a credit amount, but not both! They can both be 0.00 but they can't both be more than 0.00.

Sounds rather easy, but I have major difficulties with Javascript down to the syntax.

Any help? Thanks!