How to change the tip text of getFieldDecorator dynamically?
See original GitHub issueThis 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:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@yesmeck Thanks ! With your tip I’ve made it work, here is my code in case some other people have the same quesion
用
setFields
自己设置下字段的错误信息。