question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

formRender() on a single form renders all forms.

See original GitHub issue

I don’t understand why both forms are being rendered in this example? I was expecting only form1 to be rendered. Can this be done on a page with multiple forms?

<body>
  <section id="section1">
  </section>
  <section id="section2">
  </section>
</body>
  $(function() {
    var form1 = $('<textarea/>').attr('id', 'form1').appendTo($('#section1'))
    var form2 = $('<textarea/>').attr('id', 'form2').appendTo($('#section2'))
    var formData = '<form-template><fields><field class="form-control" label="Full Name" name="text-input-1459436848806" type="text" subtype="text"></field><field class="form-control" label="Select" name="select-1459436851691" type="select"><option value="option-1">Option 1</option><option value="option-2">Option 2</option></field><field class="form-control" label="Your Message" name="textarea-1459436854560" type="textarea"></field></fields></form-template>'

    $(formData).appendTo(form1)
    $(formData).appendTo(form2)

    $(form1).formRender()
  });

https://jsfiddle.net/mwuh6gxe/10/

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kevinchappellcommented, Aug 25, 2016

These are great finds I plan to address today. I was able to replicate everything but haven’t had a chance to get in the code to make the fix.

There is a work around for the original issue though that I’ll post but for sure the selector issue needs to be addressed.

0reactions
bhavna11patidarcommented, Aug 13, 2018

Hello Kalvin, How can I reinitialize the Formbuilder without reloading the page

Read more comments on GitHub >

github_iconTop Results From Across the Web

Form Render Elements | Form API
Form render elements are a subset of render elements, representing elements for HTML forms, which can be referenced in form arrays.
Read more >
Form Renderer - Form.io Documentation
Most form platforms render forms on the Server (using technologies like PHP, .NET, Java, etc) and then send the rendered Form HTML up...
Read more >
React Final Form re-renders all fields while changing one ...
So, if I'd have several Fields, all of them will be re-rendered, while changing only one of them. Are there any ways to...
Read more >
The form rendering API
Django's form widgets are rendered using Django's template engines system. ... or by using the renderer argument of Form.render() , or Widget.render() ....
Read more >
How to Customize Form Rendering
If you need to customize all your forms in the same way, create instead a form ... A single call to the form()...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found