TOPIC:

mysql database query in element (select from list) - item 2 1 year 7 months ago #232555

  • Topic Author
  • mlangamer
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 24
  • Thanks: 0
Item 3 solved!
Wonderful!
Mihaela, you're awesome!
It worked!

Now I have a problem with the calculation. I already did and it worked. the person enters the date he performs the calculation and brings the result to the field in the first select. the point is that ajax does not happen in the second select.
What can I do ?

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

mysql database query in element (select from list) - item 2 1 year 7 months ago #232564

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 413
Hello again,

Thank you for the kind words.

Can you please send me the code that you have written for calculation and setting the first select list's value?

The problem is that when you change select list's value using the
ff_getElementByName('tipo_vaga').value=...
function the Actionscript doesn't recognize that the change was made.

Therefore you need to add a line of code like the following to the script that you have written in order to run the Actionscript in "tipo_vaga" select list:
ff_tipo_vaga_action();

That should run the actionscript and ajax call.

Regards,

Mihaela

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

mysql database query in element (select from list) - item 2 1 year 7 months ago #232567

  • Topic Author
  • mlangamer
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 24
  • Thanks: 0
ihaela

I put this code in
Form Piece / Before Form

echo '<script src="/includes/js/maskedinput/src/jquery.maskedinput.js"
type="text/javascript"></script>';
echo '<script>
jQuery(function($){
$("#ff_elem1930").mask("99/99/9999");
$("#ff_elem162").mask("(999) 999999999");
$("#ff_elem192").mask("99/99/9999");
});

</script>';
echo '<script src="/includes/js/moment/moment.js"
type="text/javascript"></script>';
echo "<script>function calculaIdade() {
var dtNascimento =JQuery('#ff_elem1930').val();
var dtFinal = '31/03/2019';
//alert(dtNascimento);
//formato do brasil 'pt-br'
moment.locale('pt-br');
//setando data1
var data1 = moment(dtNascimento, 'DD/MM/YYYY');
//setando data2
var data2 = moment(dtFinal, 'DD/MM/YYYY');
//tirando a diferenca da data2 - data1 em dias, mes ou ano
var idadeMeses = data2.diff(data1, 'month'); //ano = years, mes = month, dia = days
var idadeAnos = data2.diff(data1, 'years'); //ano = years, mes = month, dia = days


if(idadeMeses == 3){
JQuery('#ff_elem552').val('Educação Infantil – creche IA');
} else if(idadeAnos == 3){
JQuery('#ff_elem552').val('Educação Infantil – creche II');
} else if(idadeAnos == 4){
JQuery('tipo_vaga').value('Educação Infantil I ');
ff_tipo_vaga_action();
} else if(idadeAnos >= 5 && idadeAnos <= 7){

}
}
</script>";



The first part is of the masks of the fields

And the second is from the calculation

Includes call ff_type_vaga_action ();
But it did not work.

The calculation is working.

I am able to call the value on the first select but the second select is not working.

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

mysql database query in element (select from list) - item 2 1 year 7 months ago #232598

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 413
Hello again,

I see that you have added the ff_tipo_vaga_action() function call only in case "idadeAnos == 4". Nevertheless I doubt that the ff_tipo_vaga_action() function can be called form there but you can try once more if you unintentionally added it just to case "idadeAnos == 4" .

The way to solve this is to write the code for calculation age in Actionscript of the textfield that is meant for a date input instead of writing the code in Before Form pieces.

Then at the end of Actionscript function you can add
ff_type_vaga_action ();
Then filling in second select list will work properly.

Let me know whether you've managed to write the code in Actionscript.

Regards,

Mihaela

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

Moderators: ForumSupport
Time to create page: 0.052 seconds

Summer Sale!

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!