Form Help

TOPIC:

Unique email server validation 1 year 1 week ago #266364

  • monomgabriel's Avatar
  • monomgabriel
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 90
  • Thanks: 1
Hello we have the same problem,
We tried your package "ajaxemailcheck2" but no custom error message is displayed.
The ajax part is working and here is our code:

Here is our validation script:
function ff_cb_username_validation(element, message) {

    var english = /^[a-zA-Z0-9]*$/;
	var myreturn = '';
    if (!english.test(element.value)) {
        if (message == '') message = element.name + " This field is required and must contain english caracters ONLY .\n";
        ff_validationFocus(element.name);
        return message;
    } else if (element.value == '') {
        if (message == '') message = element.name + " This field is Required \n";
        ff_validationFocus(element.name);
        return message;
    } else if (element.value != '') {
		JQuery.getJSON("<?php return JURI::root(true); ?>scripts/php/ajaxCheckUserAvailability.php", {
                username: element.value
            }, function(data) {

                if (data.username == element.value) {
					message == '' ? myreturn = 'Username exists already!' : myreturn = message;
				}
            });
	}
    return '';
} // ff_cb_username_validation

and our Action Script:
function ff_cb_username_action(element, action) {
    switch (action) {
        case 'click':
			var myreturn = '';
			
            JQuery.getJSON("<?php return JURI::root(true); ?>scripts/php/ajaxCheckUserAvailability.php", {
                username: element.value
            }, function(data) {

                if (data.username == element.value) {
                    myreturn = '<div class="bfError" id="bfEmailError"></div>';
                } else {
                    myreturn = '';
                }                
            });
			if (myreturn != '') {
                JQuery(element).after(myreturn);
            } else {
                JQuery('#bfEmailError').remove();
            }
            break;
        default:
            ;
    } // switch
} // ff_cb_username_action

How can we display those error message, like " This username already exists\n"?
Thanks
Gabriel

Please Log in or Create an account to join the conversation.

Unique email server validation 1 year 1 week ago #266370

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 11806
  • Karma: 3
  • Thanks: 763
Hi,

if you want to check if username already exist please use this:
crosstec.org/en/blog/947-check-if-email-already-entered.html

Instead of email, you can check username.

If you get in stuck, please let me know and I will help you :)

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Unique email server validation 1 year 5 days ago #266524

  • monomgabriel's Avatar
  • monomgabriel
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 90
  • Thanks: 1
Hello Tihana and thank you again for your help!
It seems to work with this method, I'm just a bit worried by this alert message I get in the console in chrome browser:
[Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check xhr.spec.whatwg.org/ .

Otherwise it's great!

Please Log in or Create an account to join the conversation.

Unique email server validation 1 year 5 days ago #266532

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 11806
  • Karma: 3
  • Thanks: 763
Hi,

this will not affect anything, this is only notice :)

Please send me link of your form, that I can check this notice.

Regards,
Tihana

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Moderators: ForumSupport
Time to create page: 0.049 seconds

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

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!