12
You are right, there is not way at the moment to get the name of the Form.
But, there is a convention, and the name of the form is 'blockform'
So, just pass this name
class XoopsBlockForm extends XoopsForm
{
public function __construct()
{
parent::__construct('', 'blockform', '');
}
The red stars :This works with xhtml but now xoops use HTML5. And html5 have new tags and attributs. One new attribut is named 'required'. using 'required' in an input tag automatically check if the field is empty and display a message in case of error. No javascript in needed.
After few tests, I found the 'required' attribute in input tag ignores the script in javascript. I will continue to investigate.
One could try to use addEelement with false for required parameter.