Hello All
I have been trying to do some validations on my fields within my form.
My fields are as follows:
name
email
cc #
cvc
expiration
I have been able to figure out the isemail condition, as well, as adding some validation for the cvc number and expiration date. Eventually Id like to add some to the CC number.
The CVC is a 3 digit number so I have been able to do the following for regex validation: /^[0-9]{3}/
The same for my expiration. In the place holder I have mm/yyyy for the format that is required and use the following in the regex condition: /^[0-9]{2}-[0-9]{4}/
I realize the limitation with this and will also mention below
I have figured out that with the above code I should not need the isempty in addition to the regex validation because the above code makes it required to begin with.
Here is my first issue: When I purposely type incorrect information or format, the form does its thing and provides me with "Some parts of your form have not been correctly filled in" message. However, when I correct the information and hit the save button I get prompted with the same error message. Its as if the form does not register the fix.
To test I filled out the form correctly and it works. Is this a limitation within Fabrik or did I miss a setting somewhere?
Next, within my expiration date validation I realize the /^[0-9]{2}-[0-9]{4}/ code will work , so as long as the mm/yyyyy format is correct. For example, someone can enter 55/9988 and although it is an incorrect date, it will validate. Can someone give a suggestion on how I would set the code to be able to on go as high as 12 within the mm and start from the 2013 in the second, maybe no being to go higher than 2020?
Lastly, as I am new to Fabrik and just teaching myself php am I going about these validations the wrong way? Is there an easier way?
I thank you all in advance for the help
Sam
I have been trying to do some validations on my fields within my form.
My fields are as follows:
name
cc #
cvc
expiration
I have been able to figure out the isemail condition, as well, as adding some validation for the cvc number and expiration date. Eventually Id like to add some to the CC number.
The CVC is a 3 digit number so I have been able to do the following for regex validation: /^[0-9]{3}/
The same for my expiration. In the place holder I have mm/yyyy for the format that is required and use the following in the regex condition: /^[0-9]{2}-[0-9]{4}/
I realize the limitation with this and will also mention below
I have figured out that with the above code I should not need the isempty in addition to the regex validation because the above code makes it required to begin with.
Here is my first issue: When I purposely type incorrect information or format, the form does its thing and provides me with "Some parts of your form have not been correctly filled in" message. However, when I correct the information and hit the save button I get prompted with the same error message. Its as if the form does not register the fix.
To test I filled out the form correctly and it works. Is this a limitation within Fabrik or did I miss a setting somewhere?
Next, within my expiration date validation I realize the /^[0-9]{2}-[0-9]{4}/ code will work , so as long as the mm/yyyyy format is correct. For example, someone can enter 55/9988 and although it is an incorrect date, it will validate. Can someone give a suggestion on how I would set the code to be able to on go as high as 12 within the mm and start from the 2013 in the second, maybe no being to go higher than 2020?
Lastly, as I am new to Fabrik and just teaching myself php am I going about these validations the wrong way? Is there an easier way?
I thank you all in advance for the help
Sam