PHP-application has form loaded via AJAX as Bootstrp's Modal. This form sends as html
type: 'post',
dataType: 'html',
data: $('#form-client').serialize(),
cache: 'false',
processData: 'false',
but the respond may be as html (when some fields have error and needed request again) and as json (when success).
When respond is JSON I am unable get the properties of the respond. If I change dataType: 'html'
to dataType: 'json'
I am unable to get html page when error is occur (form validation).
What is the solution? Thanks.