TOPIC:

submitting the second form, 1 month 18 hours ago #242240

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 9076
  • Karma: 167
  • Thanks: 737
Ok, I have it working here.

This should go into your popup form as initialization as described before:
function ff_FORMNAME_init()
{

       window.onbeforeunload = function(){
          window.opener.ff_getElementByName("TARGET-IN-OPENER").value = ff_getElementByName("SOURCE-IN-OPENED").value;
          return null;
       }
    });
}

Replace FORMNAME with the name of your form in form => advanced => more options => click "custom".

Replace TARGET-IN-OPENER with the name (not title) of the form field in the form that opens the popup.

Replace SOURCE-IN-OPENED with the name (not title) in the popup form.

I also attached you a working set of forms. Please download and install.

You start with Cross Form 1, enter something in the first text field.
When you leave that field, a popup opens, fill in the field inside and close the popup and it will populate the value from one to the other.

You will need to edit the URL for it to work in Cross Form 1 => "Text" field => advanced => Action Script.

File Attachment:

File Name: crossforms.zip
File Size:8 KB


Regards,
Markus
Attachments:

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

submitting the second form, 2 weeks 6 days ago #242739

  • Topic Author
  • DAVIDPL
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 75
  • Thanks: 0
I want the following code:

let bf_calc_interval = null;

function ff_Seleccion_evento_init()
{
bf_calc_interval = setInterval(calc, 500);
} // ff_Seleccion_evento_init

function calc() {

var vlicencia = ff_getElementByName('cb_licencia_2020').value;

if(vlicencia =="") {

// stop the interval to stop looping
clearInterval(bf_calc_interval );

alert("!Es necesario que el deportista tenga Licencia federativa para realizar la inscripción!");
}
} // ff_Seleccion_evento_init

alert("!Es necesario que cree una nueva remesa para seguir con el proceso!");
window.open('/index.php?option=com_breezingforms&view=form&Itemid=697');
}
} // ff_Asignar_remesa_licencia_init


Now I want to do the same but in another form, with the difference that
check if the "cb_licencia_2020" field is empty, launch the message:
"The athlete does not have a license"

But it has to be done after updating data previously, because by default when I enter the license form it is empty, if I do not enter the "Federated" field
previously.

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

submitting the second form, 2 weeks 6 days ago #242743

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 9076
  • Karma: 167
  • Thanks: 737
Hi,

if I understand right, you need this part then:
var vlicencia = ff_getElementByName('cb_licencia_2020').value;
var federated = ff_getElementByName('Federated').value;

if(federated  != "" && vlicencia =="") {

Replace "Federated" with the actual name of that field.
The check is done in the if-statement:

If federated has been filled but vliencia is empty, open an alert.

Regards,
Markus

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

submitting the second form, 2 weeks 4 days ago #242851

  • Topic Author
  • DAVIDPL
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 75
  • Thanks: 0
Hi


The code works fine.

But the problem is that when I enter the Federated number, when inserting the first digit, the message is executed and it does not allow me to enter the complete federated number.

It is necessary that you can enter all the digits of the Federated field.


Scripts
Script de Inicialización
code:

let bf_calc_interval = null;

function ff_Seleccion_evento_init()
{
bf_calc_interval = setInterval(calc, 500);
} // ff_Seleccion_evento_init

function calc() {

var vlicencia = ff_getElementByName('cb_licencia_2020').value;
var vfederado = ff_getElementByName('Federado').value;

if(vfederado != "" && vlicencia =="") {

alert("!Es necesario que el deportista tenga Licencia federativa para realizar la inscripción!");

// stop the interval to stop looping
clearInterval(bf_calc_interval );
}
} // ff_Seleccion_evento_init

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

submitting the second form, 2 weeks 4 days ago #242852

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 9076
  • Karma: 167
  • Thanks: 737
Hi,

can you please try this?
var vlicencia = ff_getElementByName('cb_licencia_2020').value;
var federated = ff_getElementByName('Federated').value;

if( !JQuery(ff_getElementByName('Federated')).is(':focus') &&  federated  != "" && vlicencia =="" ) {

Regards,
Markus

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

submitting the second form, 2 weeks 4 days ago #242854

  • Topic Author
  • DAVIDPL
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 75
  • Thanks: 0
Hello

I have the same problem, it does not work when I enter the first digit, the message skips

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

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

July Sale!

Discounts for all of our extensions + support. Ending July 31st!

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!