SMS form validation

thesilverghost 07 Aug, 2012
Hello!

I'm making a web-site on Joomla 2.5 and i want to use sms service for form validation.

How it will be:
|Phone number|
|---sms code input field----| |Get sms code button|
|Submit button|

To do this "realtime" i need to use AJAX?
User fills the form, fills the Phone Number field, than pushes the "Get sms code" button. User gets the code and types it in the "sms code input field".
But the question is...how the form will get the code, sms-gate sent to user? The code must be unique for each form....Do i need to generate a code, than send it to sms-gate, and the gate will sent it to user?
I've searched all topics on this forum, but never found a full answer: how to do sms-validation inside Chronoforms.

Sincerely,
Michael Andreev
GreyHead 11 Aug, 2012
Hi Michael,

I don't think that there has ever been a post about SMS validation before.

In the way that you describe here I think that you would need to use Ajax. In the Ajax form event you could generate a random code, send the SMS message with the cURL action, and save the code to a database table together with an identifier from the form.

Then when the form is submitted use a ServerSide validation action to recover the code from the table and compare it with the form event.

If you want to do the validation entirely in the browser then you'd need to pass some hashed version of the code back in the Ajax response and compare that with the entered code (you don't want to pass a plain text version of the code).

Bob
This topic is locked and no more replies can be posted.