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 get total event response for InputNumber?

See original GitHub issue

How to get total event for InputNumber with antd??

To get total event response Input has on change method but InputNumber does not any method to acces total event response .

Which menas case 1 and case2 not getting same response. Beacause

  • case 1 --> res --> event
  • case2 —> res --> value.

Ref : antd/lib/input --> props types antd/lib/input-number–> props types (** onchange method is different for both )

handleChange(res){
 console.log(res)
}

Case 1:

` <FormItem label="Note" labelCol={{ span: 4 }} wrapperCol={{ span: 8 }} >
                            {getFieldDecorator('note', { rules: [{ required: true, message: 'Please input your note!' }], onChange: this.handleChange })(
                                <Input />
                            )}
                        </FormItem>`

Case 2:

 <FormItem label="Note" labelCol={{ span: 4 }} wrapperCol={{ span: 8 }} >
                            {getFieldDecorator('note1', { rules: [{ required: true, message: 'Please input your note!' }], onChange: this.handleChange })(
                                <InputNumber />
                            )}

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
benjycuicommented, Feb 8, 2017

How about this:

<FormItem label="Note" labelCol={{ span: 4 }} wrapperCol={{ span: 8 }} >
  {getFieldDecorator('note', {
      rules: [{ required: true, message: 'Please input your note!' }],
      onChange: (e) => this.handleChange(e, 'note') // HERE!
   })(
    <Input />
  )}
</FormItem>
1reaction
iiitmaheshcommented, Feb 8, 2017

ohh its a typo mistake…!

I am doing something like below.

handleChange(e){
 console.log(e.target.name, e.target.value)
}
<FormItem label="Note" labelCol={{ span: 4 }} wrapperCol={{ span: 8 }} >
                            {getFieldDecorator('note', { rules: [{ required: true, message: 'Please input your note!' }], onChange: this.handleChange })(
                                <Input  name="note"/>
                            )}
                        </FormItem>`
Read more comments on GitHub >

github_iconTop Results From Across the Web

event.target.value as a number? - javascript - Stack Overflow
You'll have to convert it to a number yourself explicitly, if that's what you want. const numValue = Number(event.target.value); // use numValue.
Read more >
ASP.NET Core Blazor forms and input components
Learn how to use forms with field validation and built-in input components in Blazor.
Read more >
Force response with JavaScript and HTML questions
I'm working on a questionnaire which has a couple of custom questions based on JS and HTML. I would like to make sure...
Read more >
C++ User Input - W3Schools
Creating a Simple Calculator. In this example, the user must input two numbers. Then we print the sum by calculating (adding) the two...
Read more >
Lambda Function Input Event and Response Format
Input Event Format · timeToLive – The length of time or number of turns in the conversation with the user that the context...
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