kevinchappell / formBuilder

A jQuery plugin for drag and drop form creation
https://formbuilder.online
MIT License
2.63k stars 1.4k forks source link

Create typeUserAttr type of hidden to hide attributes on stage #905

Open sxndy1 opened 5 years ago

sxndy1 commented 5 years ago

Description:

Hi, as I don't want to display the className-Attribute for users, I'm disabling it in the options. But I need a value in it: 'iCheck'. So I decided to set an typeUserAttrs on my checkbox with a className of "iCheck".

Well, but now formBuilder is showing my disabled className-Attribute! Looks like typeUserAttrs is overriting disabledAttrs. Is there any workaround?

options = {
   disabledAttrs: [
      'className'
   ],

   typeUserAttrs: {
      "checkbox-group": {
         className: {
            value: 'iCheck'
         }
      }
   }
}

Environment Details:

Expected Behavior

className-Attribute not visible.

Actual Behavior

className-Attribute is visible.

lucasnetau commented 1 year ago

Attach a callback to the onAdd event for the checkbox-group and hide the className label and input (or set readonly) is the quickest way of doing this

lucasnetau commented 10 months ago

A attribute type of hidden can solve this