Element Validations

samsun076

New Member
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
 
Sorry, just jumping in here with a comment. You do realise that storing cc and cvv nd expiry dates are VERY DANGEROUS. I do not know what your application must do but thats a serious security risk for you clients. You will have to thinkmhow you can split the data so that a potential hacker cannot link them up. Also for that purpose do not name the fields in such a way that its not immediately obvious what they contain.

Ideally these tables should also be encrypted according to mastercard/visa rules.

Just a comment .....
 
hey guys
So I figured out the my issue was human error.
/^[0-9]{2}-[0-9]{4}/ has the '-' and I was putting in the /.
With that said if I wanted to replace the - with /, would it just be as simple as using quotations --> '/'.

CountryTrash - the input you provide is definately food for thought and I am researching this as we speak. Let me give a little back ground on what it is that I am doing.
The site is a private site for board members of a non- profit organization.
they have a user created and use it to gather various pieces of information.

There is a donation section where the member fill out a form and input their cc#. The information is NOT emailed, and just stored in the db table.

Another person has access to this table and would run the credit card for the desired amount. currently the same thing is done but a physical form is mailed to the person running the card.

IN terms of security. The site is https protected with an SSL cert for when the information is transmitted from the enduser to the db.

In terms of Joomla security I am using various tools like akeeba admin tools and other safeguards to protect from being hacked.

Are these measures still no safe. I welcome suggestions. As I said I am taking yours and looking into your suggestion of securing the table
 
If you want to replace - by /, you have to escape the character, so it won't be confused with the delimiters.
So, write \/ instead of -
 
For the security aspect, you should probably use the "encrypt data" feature (for the fields and textarea elements only). That is located in the "access" tab of the element.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top