From 965d8d00b0fdb54c957bd59f879b03349a1d70e9 Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Sat, 14 Apr 2012 22:43:02 +1200 Subject: [PATCH] BUGFIX: fix error location for radio fields. Fixes #5635 and #6846. --- code/model/UserDefinedForm.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/model/UserDefinedForm.php b/code/model/UserDefinedForm.php index 7b6131b..4fabcd3 100755 --- a/code/model/UserDefinedForm.php +++ b/code/model/UserDefinedForm.php @@ -469,6 +469,13 @@ class UserDefinedForm_Controller extends Page_Controller { $("#Form_Form").validate({ ignore: [':hidden'], errorClass: "required", + errorPlacement: function(error, element) { + if(element.is(":radio")) { + error.insertAfter(element.closest("ul")); + } else { + error.insertAfter(element); + } + }, messages: $messages ,