Ok, I tried making three different fields from the item form required but I have a different problem with each.
First I tried making the first field from my Extra Fields required, so I used this:
} else if (trim( document.adminForm.K2ExtraField_1.value ) == "") { alert( '<?php echo JText::_('You must fill Extra Field 1', true); ?>' );
The problem was that I was then unable to save items from categories without extra fields. Do you know a way of making the extra field required ONLY IF one of certain categories were chosen?
Then I tried making the content field, the one for text with the editor, required. I used this:
} else if (trim( document.adminForm.text.value ) == "") { alert( '<?php echo JText::_('You must fill the description in the Content tab', true); ?>' );
But then I couldn't save items untill I pressed the "toggle editor" button and left the text area without editor. I don't get why that happened. What would I have to do to make that field required without having to loose my editor for saving?
Finally I tried making the tags field required. I tried this then:
} else if (trim( document.adminForm.tags[].value ) == "") { alert( '<?php echo JText::_('You must attach tags to the item.', true); ?>' );
I really don't know about "tags[]". Anyway, after putting that in the code I could still save the form even though I left the tags field empty. Do you know what I had to write to make the tags field required?
Could you help me with any of the three fields or all three of them?
Thank you in advance!