Coder Social home page Coder Social logo

Comments (9)

KBasher avatar KBasher commented on May 18, 2024

Hi, I have fixed the binding issue. Now in edit mode the form element is binding.
But every time it is adding a extra Submit button.

How can I stop adding the Submit button with my form?

from ngformbuilder.

randallknutson avatar randallknutson commented on May 18, 2024

I've added a pull request to fix this issue for you. You can use the bugfix/submit-append branch or we should have this merged in shortly.

from ngformbuilder.

KBasher avatar KBasher commented on May 18, 2024

Hi Randallknutson,
I have downloaded this file from link https://github.com/formio/ngFormBuilder/blob/1707a42e9b427cb77c8bacfa04437f7ef4616fc2/dist/ngFormBuilder-complete.js in which you have made changes I think and have replaced my previously used formbuilder js file http://npmcdn.com/[email protected]/dist/ngFormBuilder-complete.js.

But your changed js file still adding a submit button and a new problem is showing, my form component binding is not working.

I have tested replacing the old js file and new js file but yours one is not working.

from ngformbuilder.

laradevitt avatar laradevitt commented on May 18, 2024

@KBasher - If it helps, this is the code change introduced in #171 above:

94b0c31#diff-d01c1a9377f9d59c6753be3220a04563

from ngformbuilder.

Robmacker avatar Robmacker commented on May 18, 2024

@laradevitt - my friend @KBasher and I thank you for that!

from ngformbuilder.

KBasher avatar KBasher commented on May 18, 2024

I have downloaded the file dist/ngFormBuilder-complete.js and added in place of http://npmcdn.com/[email protected]/dist/ngFormBuilder-complete.js. Using the new one my form binding in edit mode is not working and extra submit button is adding still.

from ngformbuilder.

KBasher avatar KBasher commented on May 18, 2024

Hi, I have download the js code from http://npmcdn.com/[email protected]/dist/ngFormBuilder-complete.js and made changes in three places and it work for me both form binding in edit mode and extra submit button is not adding.

original code
if (!$scope.form || !$scope.form.components || !$scope.form.components.length) { $scope.form = {components:[submitButton]}; } else { $scope.form.components.push(submitButton); }
changed code

if (!$scope.form || !$scope.form.components || !$scope.form.components.length) { $scope.form = {components:[]}; } else { //$scope.form.components.push(submitButton); }

and I comment that line

if ($scope.formio && $scope.formio.formId) { $scope.formio.loadForm().then(function(form) { $scope.form = form; $scope.form.page = 0; if ($scope.form.components.length === 0) { //$scope.form.components.push(submitButton); } }); }

from ngformbuilder.

randallknutson avatar randallknutson commented on May 18, 2024

I've added a new pull request in #173 that will give an option to not add submit buttons. Use it like this:

from ngformbuilder.

KBasher avatar KBasher commented on May 18, 2024

The problem is fixed. Thanks.

from ngformbuilder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.