TOPIC:

List value change values on other list 2 months 2 days ago #250768

  • Topic Author
  • Luisserafim
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 152
  • Thanks: 0
Hi Tihana!

ok, no prob:

List 1 Number of elements in the family:

0;;
0;1;1
0;2;2
0;3;3
0;4;4
0;5;5
0;6;6
0;7;7
0;8;8
0;9;9

List 2 Number of girls in the family:

0;;
0;1;1
0;2;2
0;3;3
0;4;4
0;5;5
0;6;6
0;7;7
0;8;8
0;9;9


So, if you have 5 kids (and 3 of those are girls) the List 2 can only accept 5 as limit so you can choose 3...

confused? Sorry me

Thanx in advance

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

List value change values on other list 1 month 4 weeks ago #250808

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

I am a little confused LOL
Do you have a specific list for girls and boys, or just 2 select list (one for number of kids, and one for boys and girls)?

Regards,
Tihana

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

List value change values on other list 1 month 4 weeks ago #250812

  • Topic Author
  • Luisserafim
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 152
  • Thanks: 0
Hi Tihana!

It is an example. what i actually have is a list of 1 to 9 family members and on another page I have another list where i will choose the number of disabled people in this family. if I only have 2 elements I cannot have 5 disabled elements.

So, I want one list to change the values ​​of another.

Please help.

Best regards

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

List value change values on other list 1 month 4 weeks ago #250814

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

e.g.
if you have first select list with name list1 defined like this:
0;;
0;1;1
0;2;2
0;3;3
0;4;4
0;5;5
0;6;6
0;7;7
0;8;8
0;9;9

and second select list with name list2 defined like this:
0;;
0;1;1
0;2;2
0;3;3
0;4;4
0;5;5
0;6;6
0;7;7
0;8;8
0;9;9

Go to your first select list->Advanced->Actionscript->check Custom->and put this:
function ff_list1_action(element, action)
{
    switch (action) {
        case 'change':


if(ff_getElementByName('list1').value=='1') {
jQuery('#ff_elem23574 option[value="2"]').attr("disabled", true);
jQuery('#ff_elem23574 option[value="3"]').attr("disabled", true);
jQuery('#ff_elem23574 option[value="4"]').attr("disabled", true);
jQuery('#ff_elem23574 option[value="5"]').attr("disabled", true);
jQuery('#ff_elem23574 option[value="6"]').attr("disabled", true);
jQuery('#ff_elem23574 option[value="7"]').attr("disabled", true);
jQuery('#ff_elem23574 option[value="8"]').attr("disabled", true);
jQuery('#ff_elem23574 option[value="9"]').attr("disabled", true);
}
else if(ff_getElementByName('list1').value=='2') {
jQuery('#ff_elem23574 option[value="3"]').attr("disabled", true);
jQuery('#ff_elem23574 option[value="4"]').attr("disabled", true);
jQuery('#ff_elem23574 option[value="5"]').attr("disabled", true);
jQuery('#ff_elem23574 option[value="6"]').attr("disabled", true);
jQuery('#ff_elem23574 option[value="7"]').attr("disabled", true);
jQuery('#ff_elem23574 option[value="8"]').attr("disabled", true);
jQuery('#ff_elem23574 option[value="9"]').attr("disabled", true);
}

         break;
        default:;
    } // switch
} // ff_list1_action
Please don't forget to change list1 with name of your current list (not title), and #ff_elem23574 with ID of your second select list (right click to your browser and find ID for this select list).

Basically, what I do is the following:
-if someone select 1 from first select list then in second select list is enabled only 1, other values are disabled, if someone select 2 from first select list, then in second is enabled 1, 2, other values are disabled.
And so on.

On this way you can disabled the values you want.
This is just an example.
I hope it helps you get what you want :)

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

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

List value change values on other list 1 month 4 weeks ago #250820

  • Topic Author
  • Luisserafim
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 152
  • Thanks: 0
Hi Tihana!

This is exactly what i need but it doesn't work.
I replaced the elementnumber and choosed Change in the action.

Blocks the form and I can't go to page 3 where this list is. it doesn’t go from the first page. The next button doesn’t do anything.

Best regards

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

List value change values on other list 1 month 4 weeks ago #250821

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

there is some error on your page->when you inspect page you will see this.

This works for me, but if you want you can send me your form on the mail, and I will test this on your form

Regards,
Tihana

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

Last edit: Post by tihana.krivic.
Time to create page: 0.049 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!