Welcome, Guest

Auto validate look
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: Auto validate look

Auto validate look 2 years, 1 month 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, 1 month 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, 1 month 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, 1 month 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, 1 month 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, 1 month 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.37 seconds

About

Crosstec GmbH & Co. KG

Bergisch-Gladbacher-Str. 829

51069 Cologne, Germany