In HTML only single form can be submitted, so in your case only the data from the form where a4j:commanButton
resides is submitted from client to server. execute
attribute impacts only server side processing, it does not change how data is submitted. So adding to execute
a different form makes it actually processed on server side, but since there are no submitted values it means there is nothing to validate.
Alternative solutions are:
(preferred) Put popup with the button to the same form which needs to be submitted and validated.
Put a a4j:jsFunction to contentForm and call it from popup, code would look like this:
.
<h:form id="contentForm">
.. other fields to be submitted ..
<a4j:jsFunction name="executeContentFormAction" execute="@form" render="@form"
action="#{...}"
oncomplete="if ..."/>
</h:form>
...
<a4j:commandButton
id="saveContentChanges"
value="Speichern"
onclick="executeContentFormAction(); return false;">