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.

How to set the Dynamic Field value? Form

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.9.2

Environment

mac os 10.13.6 (17G2307) 
chrome  69.0.3497.81(正式版本) (64 位)

Reproduction link

Edit on CodeSandbox

Steps to reproduce

1. press Add field
2. press 报错
3. press 可以添加

What is expected?

can set the value of a component based on dynamic field name

What is actually happening?

Warning: You cannot set a form field before rendering a field associated with the value.


如何用setFieldsValue()给动态添加的文本框进行赋值?

Issue Analytics

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

github_iconTop GitHub Comments

42reactions
afc163commented, Sep 12, 2018

Please learn ES6 seriously.

https://codesandbox.io/s/3q35povy1p

    this.props.form.setFieldsValue({
-     a: 'antd'
+     [a]: 'antd'
    });
4reactions
sundayhacommented, Sep 12, 2018

@afc163 ok! thanks!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change the value of a dynamic form field in antd?
I have a dynamic form in antd. I want to change another field's value based on the value of another field. I am...
Read more >
Dynamic Field Value - Piotnet Forms
Since Piotnet Forms Version 2.0 was released. You can set Dynamic Default Value for Fields by using Dynamic Tags right inside the field...
Read more >
Setting Field Default Values Dynamically - Caldera Forms
The simples method is to use the a magic tag in the field's default value setting. Select fields have additional settings for field...
Read more >
Form Fields: Dynamically Display Inputted Details, in Real-Time
Give your form users the ability to see their inputs display and update in real-time. When entering booking information, for example, ...
Read more >
Dynamic (Relationship) - Formidable Forms
Populate fields with values from selected entry · Go into the 'Select entry' form's Settings. Select 'Redirect to URL' and insert the URL...
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