Suppose I have a pop-up window that contains a form. I must have a controller that processes the form, and depending on the result, this controller returns either JSON (if all goes well, and popup can be closed by javascript) or HTML (if the form data is not valid and form must be replaced with a new html - with the validation error messages). So I found just such a solution: that's form:Suppose I have a pop-up window that contains a