• Resolved Nicscott01

    (@nicscott01)


    Not sure if anybody has come across wanting to do this, but I’d like to be able to validate my data on the front end (wp-admin or acf/front-end form) but save the raw version of it to the database. For example:

    Phone number validates to (123) 456-7890 x12345

    Save to db as 1234567890×12345.

    Then run the masked-input.js on the front end when printing the data.

    For my data import, I feel that this would be better and cleaner. But maybe I’m only concerned about that one moment in time…maybe somebody should talk me off the ledge?

    https://ww.wp.xz.cn/plugins/validated-field-for-acf/

Viewing 1 replies (of 1 total)
  • Plugin Author doublesharp

    (@doublesharp)

    Hi @nicscott01,

    I think you would need to use the acf/save_post action to format the value in the $_POST after it has been validated t achieve what you are talking about. It’s going to be app specific as to the best design and data formats so hard to say there.

    Good luck!

Viewing 1 replies (of 1 total)

The topic ‘Validate the data, but save non-validated version’ is closed to new replies.