aboutsummaryrefslogtreecommitdiffstats
path: root/web/js
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-11-24 17:39:00 +0000
committerStruan Donald <struan@exo.org.uk>2011-11-24 17:39:00 +0000
commit6bac380784eebb21ea8e6d251501281704203996 (patch)
tree351fe9a5e703d098f4fdb2297f8d6f6243fdb26d /web/js
parentedcbfb56ec4202f9c64e93905ed5a6da305ad028 (diff)
change the way we display validation errors to get round ios 5 bug
Diffstat (limited to 'web/js')
-rw-r--r--web/js/fixmystreet.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/web/js/fixmystreet.js b/web/js/fixmystreet.js
index 3d248a5dc..33d2a0a0f 100644
--- a/web/js/fixmystreet.js
+++ b/web/js/fixmystreet.js
@@ -73,7 +73,15 @@ $(function(){
// we do this to stop things jumping around on blur
success: function (err) { if ( form_submitted ) { err.addClass('label-valid').html( '&nbsp;' ); } else { err.addClass('label-valid-hidden'); } },
errorPlacement: function( error, element ) {
- element.parent('div').before( error );
+ /* And all because the .before thing doesn't seem to work in
+ mobile safari on iOS 5. However outerHTML is not cross
+ browser so we have to have two solutions :( */
+ if ( element[0].outerHTML ) {
+ var html = element.parent('div').html();
+ element.parent('div').html( error[0].outerHTML + html );
+ } else {
+ element.parent('div').before( error );
+ }
},
submitHandler: function(form) {
if (form.submit_problem) {