Welcome, Guest
  • Page:
  • 1
  • 2

TOPIC: Auto validate look

Auto validate look 2 years, 5 months ago #10581

Hi.
I thought about automatical validate of fields, presenting the validation
on top as it does the manual validation.

function ff_telefono_action(element, action)
{
    if (element.value.length!=9) {
	ff_getElementByName(element.name).style.backgroundColor = "#f00"; 
        ff_validationFocus(element.name);
        [b]return message;[/b]//this the return message
    }else ff_getElementByName(element.name).style.backgroundColor = "#fff"; 

    return '';
} // ff_xx_action


I change the colors of fields, but don't show the message on top
Hoto?
  • Arias
  • OFFLINE
  • Fresh Boarder
  • Posts: 16
  • Karma: 0

Re: Auto validate look 2 years, 5 months ago #10592

will be a little difficult. You could try to to move that bfErrorMessages DIV out of the screen before the validation.
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
Follow us on Twitter
===============================================

Re: Auto validate look 2 years, 5 months ago #10610

I do not understand, how can I do that.
When valid form with the submit button at the top error messages appear in ajax. I want to do this by changing the focus in each field.
I bring up an alert, but I think I can get better performance from breezingforms
  • Arias
  • OFFLINE
  • Fresh Boarder
  • Posts: 16
  • Karma: 0

Re: Auto validate look 2 years, 5 months ago #10644

You can move the error like this (as init script in the form settings => more options => custom => click create code framework.

Inside the generated function, add this

$jq(".bfErrorMessage").css("position", "absolute");
$jq(".bfErrorMessage").css("top", "-1000px");
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
Follow us on Twitter
===============================================

Re: Auto validate look 2 years, 5 months ago #10654

i'm use the quick mode...
I write the code in code framework ;

FORM->ADVANCED->FORM OPTION-MORE OPTIONS->SCRIPT-INIT SCRIPT->CUSTOM.

$jq(".bfErrorMessage").css("position", "absolute");
$jq(".bfErrorMessage").css("top", "-1000px");


My element:telephone

PROPERTIES->VALIDATION->CUSTOM->code framework

function ff_telephone_validation(element, message)
{
   
    if (element.value.length!=9) {
ff_getElementByName(element.name).style.backgroundColor = "#f00"; //change color to red if the validation wrong
        ff_validationFocus(element.name);//get the focus
        bfShowErrors(message);//this is the order to appears the error on top?
        return message;//or this is?
    }else{
 ff_getElementByName(element.name).style.backgroundColor = "#fff";   //if the validation is correct, change the color to white
}

    return '';
} // ff_telephone_validation


the validation is correct, but dont shows nothing on the top.

if change the line
return message;

to
return alert(message);

correctly displays an alert.

Howto work the bfShowErrors(message); funtion?

i don't know where are these funtions; only I could see the ff funtions.

Best regards
  • Arias
  • OFFLINE
  • Fresh Boarder
  • Posts: 16
  • Karma: 0

Re: Auto validate look 2 years, 5 months ago #10655

It works!

this is my code:

function ff_telefono_action(element, action)
{
    if(typeof bfUseErrorAlerts != 'undefined'){
     $jq(".bfErrorMessage").html('');
     $jq(".bfErrorMessage").css("display","none");
    }
 

    if (element.value.length!=9) {
	ff_getElementByName(element.name).style.backgroundColor = "#f00"; 
        ff_validationFocus(element.name);
        bfShowErrors(message);
        return message;
    }else ff_getElementByName(element.name).style.backgroundColor = "#fff"; 

    return '';
} // ff_xx_action


Thanks !
  • Arias
  • OFFLINE
  • Fresh Boarder
  • Posts: 16
  • Karma: 0
  • Page:
  • 1
  • 2
Moderators: TheMuffinMan, ForumSupport
Time to create page: 0.58 seconds

Facebook Discount - 40% Off!

Fans of our Facebook page here are entitled to get a 1-year-subscription for the price of a 6-months!

Steps to take:

  • Become a fan on Facebook (Like) here
  • Purchase a 6-months-subscription from here
  • Write a quick email to This email address is being protected from spambots. You need JavaScript enabled to view it. with your username and prove of your like and we'll upgrade to the 1-year-subscription

Joomla!® Forms Discount - 40% Off!

Already purchased a forms extension from a different vendor but your requirements changed and now you need a forms extension that is capable of more than just the standards? We help you to keep the costs for a change under control: Get a 40% discount on our professional membership plan! -- meaning timely unlimited access to all current and future commercial extensions, breezingforms themes & apps and Joomla!® templates at crosstec.de, including 1 year of support -- without any website limitations -- Just prove that you previously purchased another forms extension for Joomla!® from a different vendor and you are qualified.

Steps to take:

  • Purchase a 1-year-subscription from here
  • Write a quick email to This email address is being protected from spambots. You need JavaScript enabled to view it. with your username and prove of the purchase for the other form vendor and we'll upgrade to the professional-subscription

About

Crosstec GmbH & Co. KG

Bergisch-Gladbacher-Str. 829

51069 Cologne, Germany

Imprint