HDIV does not exclude params from validation even after exclusion - thymeleaf

I am using HDIV version 3.2.0,
excluding a param as below:
registry.addParamExclusions("param1").forUrls("/section/.*");
But when I try to submit the form with "param1"(hidden param and setting value using jQuery), HDIV still validates this parameter and form submission fails.
Thanks for your help!
Regards,
Subbu

Related

.net mvc does not auto trigger validation using iCheck.js and select2.js

in my mvc4 application,i user select2 and iCheck plugins to make form behaviours nicely, but some questions occured when validating models.
form ellments that using select2 and iCheck do not validate automatically when value changes.
but when i submit the form, validation trggered.
I want the form elements using select2 and iCheck validate automatically when value changes, just as the valdations behaviour on textbox.
below image validation is trggered when submit the form,this is well
when i select a not empty value, the error message still stay here, how to solve it?
it will validate when i submit the form again.
$("-select2 element-").on("change",function(){
$(this).valid();
});
to validate each time the element changes.

remove all html tag before validation

is there a clean way to remove all html tag of all attributes before validation
I found acts_as_sanitized that seemed to be perfect, but for rails 2 :-s
thanks
The sanitize gem:
https://github.com/rgrove/sanitize
Does what you need.
Call Sanitize.clean(htmlstring). You can whitelist allowed tags as well.

Grails form token not available for ajax forms?

In grails it is easy to add tokens to prevent form double submission and also the click hijacking.
Just add useToken="true" to the form tag:
<g:form ... useToken="true" >
But, this is not available for formRemote tag. I know that I can do normal form and write js code to transform them into ajax froms with token, but because of that is odd that is not supported by default in the formRemote tag.
Any reason for this, or is just (another) bug in Grails?

SpringSecurityCore grails plugin breaks my (previously working) multipart upload form

Well not the form exactly - but the action that the form submits to.
Whats is happening is that SpringSecurity is wrapping the request in its own request context that obviously has a lot of security happening in it. My action that catches the POST request from the form breaks on this line:
def f = request.getFile('myFile')
with the error message:
No signature of method: org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestWrapper.getFile() is applicable for argument types: (java.lang.String) values: [myFile]
Anyone know how to get at the actual file from the request?
Is your form a proper file upload form? It needs the enctype="multipart/form-data" attribute set. If you're using <g:form> you can switch to <g:uploadForm> which adds that for you.
Just let me know if you are using or to submit your form.
If possible please add your complete Form Code

Struts2 and form validation of prefilled forms

I'm using the validate() - method of struts2 to validate the form input. In my struts.xml I can define a result with name "input" which is displayed if the validation fails. This for the context :-)
Now my question: the form I want to validate contains a selectbox which is filled out of a database. The first time the form is displayed everything works fine. But if I validate the form and the "input" - result is displayed, I get an IOException because of the iterator which outputs the db-result into my selectbox. Is there a solution from struts2 or do I have to use a plugin or something like that? Thank you!
When validation fails, it's often necessary to "reload" data for the form page. There's a FAQ entry that covers repopulating controls after validation, mainly detailing the Preparable interface (preferred) and the use of the <s:action> tag (there are some subtle gotchas that can pop up with this, but in general, it's also okay).

Resources