Remove client side validation for the min-/maxlength of various fields
This commit is contained in:
parent
5d475c961c
commit
348afe1723
view/src/main/java/se/su/dsv/scipro/match
@ -22,7 +22,15 @@ public class IdeaTholanderCompletionPanel extends Panel {
|
||||
|
||||
private void textField(String id, IModel<String> model) {
|
||||
TextArea<String> textArea = new TextArea<>(id, model);
|
||||
textArea.add(StringValidator.maximumLength(TholanderBox.MAX_CHARS));
|
||||
textArea.add(
|
||||
new StringValidator(null, TholanderBox.MAX_CHARS) {
|
||||
@Override
|
||||
protected boolean hasLengthAttribute(String tagName) {
|
||||
// remove the maxlength attribute from the tag to disable client side validation
|
||||
return false;
|
||||
}
|
||||
}
|
||||
);
|
||||
textArea.setRequired(true);
|
||||
add(textArea);
|
||||
|
||||
|
@ -307,7 +307,15 @@ public class ProjectIdeaSubmissionPanel extends GenericPanel<Idea> {
|
||||
LambdaModel.of(getModel(), Idea::getTitle, Idea::setTitle)
|
||||
);
|
||||
title.setRequired(true);
|
||||
title.add(StringValidator.minimumLength(MIN_TITLE_LENGTH));
|
||||
title.add(
|
||||
new StringValidator(MIN_TITLE_LENGTH, null) {
|
||||
@Override
|
||||
protected boolean hasLengthAttribute(String tagName) {
|
||||
// remove the minlength attribute from the tag to disable client side validation
|
||||
return false;
|
||||
}
|
||||
}
|
||||
);
|
||||
add(new ComponentFeedbackPanel("titleFeedback", title));
|
||||
add(title);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user