This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

React Cookbook: Tracking changes in an antd form

 
Ranch Hand
Posts: 863
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
D & D,

Another newbie question -- I'm working on an inherited (from another developer) browser app that has a data entry form that can be used to either create a new request or edit an existing one. It uses the antd library for the various fields and I've been asked to modify the code so that when the user is editing an existing request, the Save button is disabled unless one or more of the fields has been changed.  This makes sense but I'm concerned about keeping track of whether or not anything has changed.  When the user is editing an existing request, I have access to the original data returned by a web service, so I could make use of each field's onChange method and compare it's current value with the original, but I'm hoping there's a better way. Any suggestions?

Thanks,
Burk
 
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don’t need to keep track of touched values yourself; antd will do that for you and pass the information to the form handlers. antd also has form validation that you can leverage.

Check out the examples on the Form page for details. Granted, the antd documentation is not the best, but you should be able to find what you are looking for.
 
Author
Posts: 133
15
Android Python Ruby
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree with Bear
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic