gitana / alpaca

Alpaca provides the easiest way to generate interactive HTML5 forms for web and mobile applications. It uses JSON Schema and simple Handlebars templates to generate great looking, dynamic user interfaces on top of Twitter Bootstrap, jQuery UI, jQuery Mobile and HTML5.
http://www.alpacajs.org
Other
1.29k stars 371 forks source link

Issue in Alpaca Form field #543

Open jaiminrockersinfo opened 6 years ago

jaiminrockersinfo commented 6 years ago

Hello,

Can you check all field?

  1. In this date picker field is not working, when I added Field Name in date picker field then all field are remove form design portion.
  2. Same here in Date field is not working.
  3. Also Multiple file upload is not working.
  4. In Currency Field, Where I can Added Field Name. Please check.

I really stuck in alpaca form field. Please check all field and update me as soon as possible.

ambischof commented 6 years ago

Your issues are a bit vague. Could you add a jsfiddle or at least some code which illustrates the bugs?

jaiminrockersinfo commented 6 years ago

Hello, Hope, this will help you for above steps of alpaca. Url: http://www.alpacajs.org/demos/form-builder/form-builder.html

  1. Goto design section.
  2. Take Date picker field after open the popup box click on setting icon.
  3. Enter any name in field name box of date picker field.
  4. Save & check it.
ambischof commented 6 years ago

Ahh, your issue isn't with Alpaca itself, but with the form builder, which does seems to have a bug. It would actually work if you scroll down to the bottom of the options and clear the DatetimePicker Options which has a value of [object Object]

I wouldn't rely too heavily on the form builder but if you do use it, pay close attention to what it has in the source.

musicdsign commented 6 years ago

Yes, I am experiencing the same thing when the [object Object] in the DatetimePicker Options field is not deleted.

The console says there is an unhandled exception that is not caught. I have a workaround for this by modifying the picker.options function in the bootstrap-datetimepicker.js file:

picker.options = function (newOptions) { if (arguments.length === 0) { return $.extend(true, {}, options); }

        if (!(newOptions instanceof Object)) {
            throw new TypeError('options() options parameter should be an object');
        }
        $.extend(true, options, newOptions);
        $.each(options, function (key, value) {
            if (picker[key] !== undefined) {
                picker[key](value);
                //console.log(key);
            } else {
        //Added this condition to prevent "0" key error 10-31-17 DS
                if (picker[key] > 0) {
                throw new TypeError('option ' + key + ' is not recognized!');
                }
            }
        });
        return picker;
    };

The part I added is the condition: //Added this condition to prevent "0" key error 10-31-17 DS if (picker[key] > 0) {

Before doing that, the TypeError that was thrown was 'option 0 is not recognized' so by making sure the key was greater than 0 avoided this error and the form would not disappear. However it is probably a hack at this point until the real issue is dealt with. I am also having the same disappearing act happening when I use a single quote in the Field Name input (ie. Payer's Name). Anyone know how to escape a single quote in this field?