I´m using TyneMCE and I have 2 fields in my form that I want to be mandatory.
When I use "inst.getBody().innerHTML" in a javascript it works but only for 1 field.

What can I do to make it works for 2 or more fields?
I named the fields in my form field1 and field2

Javascript
if(form.field1.value==""){ alert('This is a mandatory field.'); }
if(form.field2.value==""){ alert('This is a mandatory field.'); }
This does not work