masking character "_" also included in database

Exclude input mask placeholder characters from database storage.

Overview

The data mask for phone numbers includes placeholder characters that are submitted with the form data.
Use a PHP function in the form's Submit event to strip out all non-numeric characters before saving the value.

Answered
ChronoForms v6
ch chekwan 24 Sep, 2018
Hi,

I have a problem with data mask.

I have put the data mask format: data-inputmask:'mask': '99999999999'
means user can enter their phone number in 10 or 11 characters.

But when user enter 10 character, I will received the data input mask character "_" inside my database.

How can I exclude this character during submission.

masking character

masking character

masking character
he healyhatman 24 Sep, 2018
Answer
1 Likes
Strip it out using PHP.
$this->data("nombor_telefon_bimbit3", preg_replace("/[^0-9]/", "", $this->data("nombor_telefon_bimbit3", "")), true);
ch chekwan 24 Sep, 2018
thanks for the reply..

this code I need to put inside the Submit event in Setup page right.?
ch chekwan 24 Sep, 2018
Your solutions is working great!

thanks healyhatman 🤗🤗
This topic is locked and no more replies can be posted.