struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Huber <gregh3...@gmail.com>
Subject Showcase app ajax validation check
Date Mon, 13 Feb 2017 10:06:33 GMT
Was looking at some client side validation, with the showcase app. I use
firefox and it was not working, it just returned Network or server error!

https://struts.apache.org/docs/ajax-validation.html

The ajax call was returning 400, so falls back onto the error function and
just displays the network error message.

Not sure the best way to make this cross-browser complaint, other than
adding a check?
..
error: function(xhr, textStatus, errorThrown) {
            if (restoreFunction) {
                restoreFunction();
            }
            // show user an error message
            if(xhr.status == 400) {
              _handleValidationResult(_form,
jQuery.parseJSON(xhr.responseText))
            } else {
              _handleValidationResult(_form, {errors: ['Network or server
error!']})
            }
        }
..

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message