Skip to content

Add the showArrowOnRadioAndCheckbox option, and change the positioning calculus a bit #714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,12 @@ Determines if the prompt should hide itself automatically after a set period. De
### autoHideDelay
Sets the number of ms that the prompt should appear for if autoHidePrompt is set to *true*. Defaults to *10000*.

### showArrow
Show the arrow in the validation popup. Defaults to *true*

### showArrowOnRadioAndCheckbox
Show the arrow in the validation popup when validating checkboxes and radio buttons. Defaults to *false*

Validators
---

Expand Down
9 changes: 6 additions & 3 deletions js/jquery.validationEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@
} else {
field = $(form.find("input[name='" + fieldName + "'][type!=hidden]:first"));
}
options.showArrow = false;
options.showArrow = options.showArrowOnRadioAndCheckbox;
}

if(field.is(":hidden") && options.prettySelect) {
Expand Down Expand Up @@ -1832,7 +1832,7 @@
switch (positionType) {
default:
case "topRight":
promptleftPosition += fieldLeft + fieldWidth - 30;
promptleftPosition += fieldLeft + fieldWidth - 27;
promptTopPosition += fieldTop;
break;

Expand All @@ -1859,7 +1859,7 @@
promptleftPosition = fieldLeft;
break;
case "bottomRight":
promptleftPosition = fieldLeft + fieldWidth - 30;
promptleftPosition = fieldLeft + fieldWidth - 27;
promptTopPosition = fieldTop + field.height() + 5;
marginTopSize = 0;
break;
Expand Down Expand Up @@ -2034,6 +2034,9 @@
binded: true,
// set to true, when the prompt arrow needs to be displayed
showArrow: true,
// set to false, determines if the prompt arrow should be displayed when validating
// checkboxes and radio buttons
showArrowOnRadioAndCheckbox: false,
// did one of the validation fail ? kept global to stop further ajax validations
isError: false,
// Limit how many displayed errors a field can have
Expand Down