I have inherited a project where we have a form that is used to record daily sales from a store. There are roughly 50 data points on the form. We have both a create and edit form setup currently. I would like to use just a single form for both initial entry and entry editing so we don’t have to maintain both forms as we add or change the data points.
The problem I’m trying to overcome is that depending on if you’re entering fresh data or editing past data we need field behavior to change. For the most part this means showing/hiding certain fields or changing certain fields to readonly on one form but not the other.
I can handle changing the fields I believe but what I don’t understand how to do is detecting which “version” of the form is being displayed, the enter or edit version. I first started going down the path of adding a hidden field and populating it dynamically via the shortcode that creates the form but I don’t know how to read the value of that field to know which fields to set to readonly and whatnot. Perhaps this hidden, pre-populated field is not the best way to accomplish this so I’m open to any suggestions.