1
I want to add some simple form validation with a javascript alert. I know how to do this with a conventional submit button, e.g.
onsubmit="javascript:return validate_my_form();"
however, the form I am editing uses the Xoops form-button object. This particular form submits to another file and simply making the fields required (true) does not seem to work.
The button code looks like this.
$search_form->addElement(new XoopsFormButton("", "submit", _SEARCH, "submit"), true);
I am no wiser about hacking the 'form' tag either
$search_form = new XoopsThemeForm(_MD_SEARCH, "search", "search.php?search=1");
Can anyone put me out of my misery and tell me how to trigger a JS alert for an empty field when the submit button is pressed?
A thread is for life. Not just for Christmas.