core icon indicating copy to clipboard operation
core copied to clipboard

Form Handler - Having a clear button for input file fields would be nice

Open gabbydotCMS opened this issue 14 years ago • 3 comments

We had a non-required binary field in a form, and since most of the browsers don't allow clearing the path after a file has been selected, we had to add a custom field with the script show next to make possible to the user to get rid of a previous selection without having to reload the whole form:

Our binary field was named "Binary Field", so "binaryfieldFieldInput" is the name of the input file generated by the form handler vtl.

It would be nice if such clear button was rendered by the form handler vtl for each input file type in the form structure.

This improvement was requested by HCA's QA team while testing Secure Form functionality.

gabbydotCMS avatar Aug 30 '12 15:08 gabbydotCMS

Included clear button for binary,file and image fields in the submit content macro.

Files Updated

  • /dotCMS/WEB-INF/velocity/static/content/binary_field_render.vtl
  • /dotCMS/WEB-INF/velocity/static/content/file_field_render.vtl
  • /dotCMS/WEB-INF/velocity/static/content/image_field_render.vtl
  • /dotCMS/html/js/content/content_form_macro.js
  • /dotCMS/html/css/content/form.css

oswaldogallango avatar Nov 08 '12 21:11 oswaldogallango

Ozzy I merged your pull request and closed the issue

jtesser avatar Nov 09 '12 15:11 jtesser

Fixed, Tested on dotCMS 2.5 // W7 // Chrome, now the button is appearing an working fine

bryanboza avatar Dec 07 '12 16:12 bryanboza