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 change the tip text of getFieldDecorator dynamically?

See original GitHub issue

This is a question about usage instead of issues, I’ve also posted this question in Stackoverflow here

In the example component NormalLoginForm from the official website here https://ant.design/components/form/, for the username item,

<FormItem>
  {getFieldDecorator('userName', {
    rules: [{ required: true, message: 'Please input your username!' }],
  })(
      <Input addonBefore={<Icon type="user" />} placeholder="Username" />
    )}
</FormItem>

If a user enters an incorrect password and the server returns an error, how to show and change the message from Please input your username! to Wrong username or password ?

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
soulmachinecommented, Nov 21, 2016

@yesmeck Thanks ! With your tip I’ve made it work, here is my code in case some other people have the same quesion

1reaction
yesmeckcommented, Nov 27, 2016

setFields 自己设置下字段的错误信息。

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change the tip text of getFieldDecorator dynamically?
Look at this example: https://ant.design/components/form/#components-form-demo-register. You can use customized validate method, and you can validate async, ...
Read more >
script to change tooltip of textfield dynamically
Iam using Adob DC Pro i want to change tooltip of a text field dynamically. that is by script. I want change 100...
Read more >
Form - Ant Design
Select a option and change input text above. Submit Reset ... Add or remove form items dynamically. add function support config initial value....
Read more >
Form - Ant Design - API Manual
An enterprise-class UI design language and React-based implementation with a set of high-quality React components, one of best React UI library for ...
Read more >
Managing File Uploads in React with Ant Design
In a recent project, I had to create a form component for a React app, and one of the form items needed to...
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