× Form Help

Unique email server validation

  • Vol3n
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 18
  • Thank you received: 0

Vol3n created the topic: Unique email server validation

Hello, Crosstec!

First I want to say Thank you for developing such great component! I've created a form using BreezingForms and I want to validate that entered email address doesn't exist in my database. Currently I am using this code in my "Begin Submit" piece:
$this->execPieceByName('ff_InitLib');

$email = '\'' . ff_getSubmit('email_test') . '\''; 
$value = ff_selectValue('SELECT * FROM kvkfr_users WHERE email= ' . "$email");

if($value != ''){
die();
}

If I enter an unique email everything works fine, but when the email is found I get a blank white page. What should I use instead of die() to achieve stopping the submitting process without refreshing a page(and maybe displaying a validation box over the email field)?
#213528
  • Posts: 5896
  • Karma: 118
  • Thank you received: 544

MarioPuco replied the topic: Unique email server validation

Hey there,


I'm sending you an example form of AJAX email validation.
What it does, it check the email element with the DB and if the email is taken the error message is displayed + form is unable to submit.


Let us know if this helped.

Regards,
Mario

Satisfied with our Support ?
PayPal Tip
===============================================
Need to renew Pro Support?
Buy Here!
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
#213531
Attachments:
  • Vol3n
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 18
  • Thank you received: 0

Vol3n replied the topic: Unique email server validation

Hmm it works as intended inside your form, but when I try to implement it inside my own form I still get the white page after submit.

Edit: I was getting the white page because I forgot to add the custom validation code to my email field. After adding the validation code I am getting
tests:570 Uncaught ReferenceError: ff_email_test_validation is not defined
error in my browser console.
#213537
  • Posts: 5896
  • Karma: 118
  • Thank you received: 544

MarioPuco replied the topic: Unique email server validation

Hello,

You can send me your login information to support@crosstec.org so I can take a look at this for you ?
Add a link to this forum topic in the email you send + please note what Form should I check.

I will get back to you ASAP.

Regards,
Mario

Satisfied with our Support ?
PayPal Tip
===============================================
Need to renew Pro Support?
Buy Here!
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
#213538
  • Vol3n
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 18
  • Thank you received: 0

Vol3n replied the topic: Unique email server validation

I cannot grant you access to my Joomla since I am using localhost.
I am getting this error after adding your custom validation function to my field:
Uncaught ReferenceError: ff_email_test_validation is not defined

Why its trying to call `ff_email_test_validation` and not `ff_email_validation` (which I included to my scripts)

Edit: I FIXED IT!!! My field was called "email_test" and renaming it to just "email" fixed my problem. Thank you so much for your help!
#213539
  • Posts: 5896
  • Karma: 118
  • Thank you received: 544

MarioPuco replied the topic: Unique email server validation

Hello,

Great !
You are learning fast :)

If you need anything else, let me know.

Regards,
Mario

Satisfied with our Support ?
PayPal Tip
===============================================
Need to renew Pro Support?
Buy Here!
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
#213540
Moderators: ForumSupporttomeperica
Time to create page: 0.068 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here