Skip to content

Commit 7fa96ac

Browse files
committed
Issu 153. Changed the error message element inside the error container from <span/> to <p/>. Most propably causes many end user CSS updates as follows:
.error p { margin: 0 }
1 parent fda0218 commit 7fa96ac

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/validator/validator.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,14 @@
158158
}
159159

160160
// clear the container
161-
msg.css({visibility: 'hidden'}).find("span").remove();
161+
msg.css({visibility: 'hidden'}).find("p").remove();
162162

163163
// populate messages
164164
$.each(err.messages, function(i, m) {
165-
$("<span/>").html(m).appendTo(msg);
165+
$("<p/>").html(m).appendTo(msg);
166166
});
167167

168-
// make sure the width is sane (not the body's width)
168+
// make sure the width is not full body width so it can be positioned correctly
169169
if (msg.outerWidth() == msg.parent().width()) {
170170
msg.add(msg.find("p")).css({display: 'inline'});
171171
}

test/validator/minimal.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,5 @@
7070
</form>
7171

7272
<script>
73-
$("form").validator();
73+
$("form").validator({ position: 'top center'});
7474
</script>

0 commit comments

Comments
 (0)