• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

How Do You Determine What Form Fields Are Posted?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How Do You Determine What Form Fields Are Posted?

    Let's say an ajax request pots a form with the following variables:

    Code:
    part: "partValue",
    store: "storeValue",
    cost: "costValue"
    I can actually perform a vvin_char on web variable bogus even though the variable was not sent with the post/get. In the case of a vvin_char, the variable bogus would contain a blank.

    So, that being said, is there a way to determine which web variables were posted?

    Here's why I want to know this.

    I have an app that contains a mass update feature with filters. So the user can filter down to the records they want to mass update, supply the values they wish to apply, then commit the changes. Well, how am I supposed to determine the difference between a 0 or blank? If they set cost to 0, how do I know (on my backend) that cost is 0 or cost was not supplied as part of the post/get? Previously, I used special values (hival for number fields and the string *BLANK for character fields). I was hoping for a "better" solution. :-)

  • #2
    I've been mulling over this for a few days, and of course, when I click save on the post above, something clicked.

    I could have the front end build a json string containing all the fields that changed. Then use vvin_json on the backend to determine which ones changed. However, if there is a more natural solution, I'd like to hear it.

    Comment


    • #3
      That's exactly what I was going to suggest -- just have your app on the front end send an array of all the variables being sent, then loop through that in your RPG program to update the appropriate fields. Nitro File Editor works the same way.

      Comment

      Working...
      X