Skip to main content
Level 4
Oct 20, 2015 11:20 AM UTC
Solved

server validation for removing html tag from text field component

I am using http://localhost:4503/libs/foundation/components/form/text/text.jsp which has sling:resourceSuperType    pointing to     foundation/components/form/defaults/field

I need to chage the validation that would throw any error from server validation if any html tag is feed say <script> </script> on the text field
please let me know how to acheive it 

currently i see 2 parameter added in the form field

required             Boolean    true    
requiredMessage         String        Please enter name


server validation for removing html tag from text field component

 

Thanks,

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
edubey
edubeyAccepted solution
Level 10
Oct 20, 2015 3:42 PM UTC

This is the path for /libs/foundation/components/form/defaults/field/servervalidation.jsp for jsp file

Override this in your project and implement your logic.

More ever I would suggest you to add some listener so that your clientside validation will also be strong.

3 replies

smacdonald2008
Level 10
Oct 20, 2015 1:03 PM UTC

To do this - you need to overlay the text and form field and then modify the servervalidation.jsp. Never modify content under /libs. 

Translate
Level 4
Oct 20, 2015 2:30 PM UTC

To overlay I  didnot find the servervalidation.jsp under /libs/foundation/components/form/text/text.jsp.

Please let me know   how to proceed

Translate
edubey
edubeyAccepted solution
Level 10
Oct 20, 2015 3:42 PM UTC

This is the path for /libs/foundation/components/form/defaults/field/servervalidation.jsp for jsp file

Override this in your project and implement your logic.

More ever I would suggest you to add some listener so that your clientside validation will also be strong.

Translate