kevinchappell / formBuilder

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

Unable to save data of rendered form- Rating control plugin #962

Closed syed-asim closed 1 year ago

syed-asim commented 5 years ago

Description:

Thanks Kevin, for creating this wonderful tool.

I am using the the rating plugin with typeUserAttrs (custom attribute) "ratingData". typeUserAttrs: { starRating: { ratingData: { label: 'Rating', value: '5' } } }

However, once i render the form > fill in the form (change the rating). And then save the userData using:

$('#' + SurveyPages[currentPageIndex].PageId).formRender('userData');

The above return the data perfectly, but the value of typeUserAttrs (custom attribute) "ratingData" remains the same i.e. 5. Below is the onRender method for rating plugin.

onRender() {
            var el = this;

            $('#' + el.config.name).rateYo({

                onSet: function (rating, rateYoInstance) {
                    $(rateYoInstance).next().val(rating);

// tried setting the config
                    el.config.ratingData = rating;
// tried setting the  raw config
                    el.rawConfig.ratingData = rating;
// tried setting the value as well
                    el.config.value = rating;
                },
                rating: el.config.ratingData || 3,
                numStars: el.config.noStars || 5,
                fullStar: true,
            });

        }

Please advise how to get the updating value. Any help would be really appreciated.

I searched google and checked all the issues as well, but couldn't find a fix for it that is why i am reporting here.

Environment Details:

Expected Behavior

$('#' + SurveyPages[currentPageIndex].PageId).formRender('userData');

Actual Behavior

Return the default value

Steps to Reproduce

Screenshot - (optional)

image

iftkharhussain commented 3 years ago

we're on the same page, please update if you found any solution. Thanks

MisterDuval commented 2 years ago

we're on the same page, please update if you found any solution. Thanks

any solution for this @iftkharhussain ?

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 3.14.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: