Changing a form when the old form has mandatory fields which are empty causes bogus error
To reproduce you need a topic containing a form.
This form must have at least one mandatory field.
Leave this field empty.
There is now a Javascript function that validate if mandatory fields are empty. This does not validate if you cancel out. If you change form it validates which means you have to put some random text into the mandatory fields to change to another form. This is confusing and makes no sense. The Change Form button should have the same onclick="suppressTWikiSaveValidation() that cancel has.
It is very confusing the way the whole thing is built up. If I add this to the form.tmpl then in all other skins than those that load twiki_edit.js OR are the Wysiwyg editor in action will fail because the suppressTWikiSaveValidation() is not defined.
It would be so much simpler if each "screen" had its own template file instead of all these includes of an include of an include that includes an include. It has become too much of a patchwork for anyone to have an overview of the consequences of any changes.
--
TWiki:Main/KennethLavrsen - 22 Jun 2008
The error is only present in the skins that have implemented the javascript that checks mandatory fields
If we add the javascript call in the generic form.tmpl you get js errors in non pattern skin
So the solution I chose was to modify the Change Form button in the pattern skin and that required a new template file.
--
TWiki:Main.KennethLavrsen - 22 Jun 2008