Forums

Validate fields from data array

livingwebstudio 18 Jan, 2016
Is it possible to validate a text field from a data array?
I have a DB Read action on load, this is the array:
Array
(
    [option] => com_chronoforms5
    [chronoform] => Articolo-new
    [emailregistrati] => Array
        (
            [0] => Array
                (
                    [email] => antonella.dipalma@unifg.it
                    [owner] => 679
                    [full_name] => 
                )

            [1] => Array
                (
                    [email] => dfsdfsdf@sd.it
                    [owner] => 0
                    [full_name] => 
                )

            [2] => Array
                (
                    [email] => dgfdgf@hghg.it
                    [owner] => 677
                    [full_name] => 
                )

            [3] => Array
                (
                    [email] => email@email.it
                    [owner] => 659
                    [full_name] => 
                )

            [4] => Array
                (
                    [email] => francesco.nastro84@gmail.com
                    [owner] => 0
                    [full_name] => 
                )

            [5] => Array
                (
                    [email] => francesco.nastro84@gmail.com
                    [owner] => 662
                    [full_name] => 
                )

            [6] => Array
                (
                    [email] => francesco.nastro84@gmail.com
                    [owner] => 663
                    [full_name] => 
                )

            [7] => Array
                (
                    [email] => francesco.nastro84@gmail.com
                    [owner] => 664
                    [full_name] => 
                )

            [8] => Array
                (
                    [email] => francesco.nastro84@gmail.com
                    [owner] => 665
                    [full_name] => 
                )

            [9] => Array
                (
                    [email] => francesco.nastro84@gmail.com
                    [owner] => 666
                    [full_name] => 
                )

            [10] => Array
                (
                    [email] => francesco.nastro84@gmail.com
                    [owner] => 667
                    [full_name] => 
                )

            [11] => Array
                (
                    [email] => francesco.nastro84@gmail.com
                    [owner] => 668
                    [full_name] => 
                )

            [12] => Array
                (
                    [email] => francesco.nastro84@gmail.com
                    [owner] => 669
                    [full_name] => 
                )

            [13] => Array
                (
                    [email] => francesco.nastro84@gmail.com
                    [owner] => 671
                    [full_name] => 
                )

            [14] => Array
                (
                    [email] => francesco.porcelli@uniba.it
                    [owner] => 675
                    [full_name] => 
                )

            [15] => Array
                (
                    [email] => giorgio.magno85+123@gmail.com
                    [owner] => 661
                    [full_name] => 
                )

            [16] => Array
                (
                    [email] => giorgio.magno85+12@gmail.com
                    [owner] => 0
                    [full_name] => 
                )

            [17] => Array
                (
                    [email] => giorgio.magno85+1@gmail.com
                    [owner] => 0
                    [full_name] => 
                )

            [18] => Array
                (
                    [email] => giorgio.magno85+testing@gmail.com
                    [owner] => 678
                    [full_name] => 
                )

            [19] => Array
                (
                    [email] => giorgio@gioo.it
                    [owner] => 0
                    [full_name] => 
                )

            [20] => Array
                (
                    [email] => giorgiooo@gmail.com
                    [owner] => 680
                    [full_name] => 
                )

            [21] => Array
                (
                    [email] => giormagno@libero.it
                    [owner] => 660
                    [full_name] => 
                )

            [22] => Array
                (
                    [email] => sdsdsds@fggfg.io
                    [owner] => 0
                    [full_name] => 
                )

        )

)

I need to validate text field on the email array.. is it possible?
GreyHead 18 Jan, 2016
Hi livingwebstudio,

What exactly do you mean by 'validate' here?

Bob
livingwebstudio 18 Jan, 2016
Hi Bob,
I need to compare the text field with the email results from array.
If the email exists in the array, the validation pass.
If the email doesn't exist .. validation fails.
I think it's possible with JS on load.. but i don't know how!
This topic is locked and no more replies can be posted.