Skip to content

Commit 88205c7

Browse files
committed
implemented resend SimpleForm if validation failed
1 parent 5090202 commit 88205c7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/ru/contentforge/formconstructor/form/SimpleForm.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ public void setResponse(String data) {
9898
} catch (Exception var4) {
9999
return;
100100
}
101-
if(buttonId >= buttons.size() || buttonId < 0) return;
101+
if(buttonId >= buttons.size() || buttonId < 0){
102+
response = new SimpleFormResponse(new Button("Invalid", (p, b) -> send(p)));
103+
return;
104+
}
102105

103106
response = new SimpleFormResponse(buttons.get(buttonId));
104107
}

0 commit comments

Comments
 (0)