Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
9b69fca5be
@ -7,7 +7,7 @@ import org.apache.wicket.markup.head.OnEventHeaderItem;
|
||||
import org.apache.wicket.markup.html.form.Form;
|
||||
|
||||
/**
|
||||
* Disables all elements with {@code [type=submit]}
|
||||
* {@link Form} behavior that disables all elements with {@code [type=submit]} when the form is submitted.
|
||||
*/
|
||||
public class DisableSubmitButtonsOnSubmit extends Behavior {
|
||||
@Override
|
||||
@ -21,10 +21,12 @@ public class DisableSubmitButtonsOnSubmit extends Behavior {
|
||||
@Override
|
||||
public void renderHead(Component component, IHeaderResponse response) {
|
||||
super.renderHead(component, response);
|
||||
final String javaScript = "const submitButtons = event.target.querySelectorAll(\"[type=submit]\");\n" +
|
||||
"for (const button of submitButtons) {\n" +
|
||||
" button.disabled = true;\n" +
|
||||
"}\n";
|
||||
final String javaScript = """
|
||||
const submitButtons = event.target.querySelectorAll("[type=submit]");
|
||||
for (const button of submitButtons) {
|
||||
button.disabled = true;
|
||||
}
|
||||
""";
|
||||
response.render(OnEventHeaderItem.forComponent(component, "submit", javaScript));
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user