TOPIC:

Can I have field based calculation using Breeze forms 2 months 3 days ago #274728

  • DSFCosta Rica
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 16
  • Thanks: 0
Hello!
Some kind like same situation here,
I just created the fields but I really dont know how to write in a good way and where to put the script...

how can I set this?

if status is Aprobado set CredidPuntos 3
if status is Condicionado set CredidPuntos 3
if status is Denegado set CredidPuntos 3

if ingresoX is 25 or less set CuotaPuntos 3
if ingresoX is 25 or more set CuotaPuntos 1

if Actividad is Asalariado en Planilla set ActividadPuntos 3
if Actividad is Profesional Independiente set ActividadPuntos 2
if Actividad is Negocio Propio Formal set ActividadPuntos 1
if Actividad is Mixto set ActividadPuntos 0

Thank you so much for your help

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

Can I have field based calculation using Breeze forms 2 months 3 days ago #274729

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

in form->Advacned->More options->Scripts->Initializaion script->check Custom:
function ff_nameofform_init()
{
setInterval('calc()', 500);
} // ff_nameofform_init

function calc() {
if(ff_getElementByName('status').value=="Aprobado") {
ff_getElementByName('CredidPuntos').value=3;
}
else if (ff_getElementByName('status').value=="Condicionado") {
ff_getElementByName('CredidPuntos').value=3;
}
else if (ff_getElementByName('status').value=="Denegado") {
ff_getElementByName('CredidPuntos').value=3;
}
//and so on
}
Please replace nameofform with name of your form (not title)

If you need more help let me know

Regards,
Tihana

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

Can I have field based calculation using Breeze forms 2 months 3 days ago #274731

  • DSFCosta Rica
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 16
  • Thanks: 0
It works! Thank you so much.
I just have a question, how to display when coding... less than 25

Like in this example...
if ingresoX is 25 or less set CuotaPuntos 3
if ingresoX is 25 or more set CuotaPuntos 1

Thanks for your patience.

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

Can I have field based calculation using Breeze forms 2 months 3 days ago #274732

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

e.g .like this:
var test=ff_getElementByName('ingresoX').value;
if(test <= 25) {
ff_getElementByName('CuotaPuntos').value=3;
}
else if(test >=25) {
ff_getElementByName('CuotaPuntos').value=1;
}

Regards,
Tihana
The following user(s) said Thank You: DSFCosta Rica

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

Can I have field based calculation using Breeze forms 2 months 2 days ago #274769

  • DSFCosta Rica
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 16
  • Thanks: 0
Well I think Im doing it wrong... please a little bit of help...


if(ff_getElementByName('Puntaje').value=="Aprobado") {
ff_getElementByName('CredidPuntos').value="Aprobado";
ff_getElementByName('GAMPuntos').value="Aprobado";
ff_getElementByName('CuotaPuntos').value="Aprobado";
}

I just want to put a value in a field Puntaje just if all the other fields show the same value...

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

Can I have field based calculation using Breeze forms 2 months 2 days ago #274773

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

the code looks ok, but could you please send me login information, backend link and form name that I can check it?

Use this tag:
[confidential]
[/confidential]
Only forum moderator can see this

Regards,
Tihana
The following user(s) said Thank You: DSFCosta Rica

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

Time to create page: 0.075 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

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

Summer 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!