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.

Multiple forms using the same fields

See original GitHub issue

Hi, I’m creating import component with table of records, like: image How can I initialize form validation for each row using the same fields? Tried creating array containing Form instances. But it doesn’t work (rows values change in the same time).

@observable recordsValidation = [];
recordsValidation.push( new Form({ plugins,  fields });
recordsValidation.push( new Form({ plugins,  fields });

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
JZiebikiewiczcommented, Oct 20, 2016

It works nice. Even without giving names to each form. Thank you for support. 😃

I just had to update package from 1.11.12 to the newest 1.13.3…

1reaction
foxhound87commented, Oct 18, 2016

recordsValidation.push is missing an ending bracket.

You can try to give a unique name for each form and print them, so we can ensure the forms has different instances:

recordsValidation.push(new Form({ plugins,  fields }, 'Form-A'));
recordsValidation.push(new Form({ plugins,  fields }, 'Form-B'));

and log: this.recordsValidation[0].name

I hope this can help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ProTip: Fill Multiple Form Fields with the Same Information
Automatically populate field data within multiple instances in the same form using the Replicated Fields feature.
Read more >
Two forms on one page with same input fields - Stack Overflow
I have a few input fiends with same ID's on the diferent forms, which are checked if they are empty with document.getElementById('id').value;.
Read more >
Same field can be added to multiple form sections of the same ...
A field can be added to multiple form sections of the same form. Currently, it's rendered each time, the one that actually gets...
Read more >
Using one field in multiple forms - Microsoft Dynamics CRM ...
I need to use 'area name' which is in 'survey' form in another form called 'person'. The users should have the ability to...
Read more >
Auto populate multiple form fields at once - Microsoft Community
I have Created a form that has many boxes that will have the same number in it. How do I auto populate all...
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