TOPIC:

Checkbox group selections to multiple textfields 3 weeks 1 hour ago #247804

  • Topic Author
  • mrperfectpz
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 326
  • Thanks: 0
Hi

I have 15 textfields named "Player1" to "Player15".
I have a checkbox group with lots of names.

How would I fill the numbered textfield with the value of the checked name up to 15 selections.

i.e

Player1 = selection1
Player2 = selection2
etc, etc

So I would need the textbox label to change to the relevant number to add the checked value to the field

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

Last edit: Post by mrperfectpz.

Checkbox group selections to multiple textfields[solved] 2 weeks 4 days ago #247898

  • Topic Author
  • mrperfectpz
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 326
  • Thanks: 0
Is anybody able to help with this subject please

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

Last edit: Post by mrperfectpz.

Checkbox group selections to multiple textfields 2 weeks 4 days ago #247902

  • tihana.krivic's Avatar
  • tihana.krivic
  • Online
  • Moderator
  • Moderator
  • Posts: 1260
  • Karma: 3
  • Thanks: 110
Hi,

I am not sure that I undestood you correctly.
You have 15 textfields.
If someone check for example first value from checkebox group then 1.textfield is populate with this value, if someone check second value from checkboxgroup then 2.textfield is populate and so on. ??

Regards,
Tihana

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

Checkbox group selections to multiple textfields 2 weeks 4 days ago #247904

  • Topic Author
  • mrperfectpz
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 326
  • Thanks: 0
Yes exactly Tihana

I have numbered the textareas Player1-15

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

Last edit: Post by mrperfectpz.

Checkbox group selections to multiple textfields 2 weeks 4 days ago #247908

  • tihana.krivic's Avatar
  • tihana.krivic
  • Online
  • Moderator
  • Moderator
  • Posts: 1260
  • Karma: 3
  • Thanks: 110
Hi,

go to your checkboxgroup->Advanced->Actionscript->check Custom->check Click->Create code frameworks and put this this:
function ff_NAMEOFCHECKBOX_action(element, action)
{
    switch (action) {
        case 'click':
let result = JQuery('input[name="'+JQuery(element).attr('name')+'"]:checked');
ff_getElementByName('nameoffirsttextfield').value=result.get(0).value; //first textfield will have the first value from checkbox group
ff_getElementByName('nameofsecondtextfield').value=result.get(1).value; //second textfield will have the second value from checkboxgroup
//and so on
            break;
        default:;
    } // switch
} // ff_NAMEOFCHECKBOX_action

Please replace:
NAMEOFCHECKBOX with name of your checkboxgroup (not title)
nameoffirsttextfield with name of first textfield (not title)
nameofsecondtextfiled with name of second textfield (not title).


Regards,
Tihana

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

Last edit: Post by tihana.krivic.

Checkbox group selections to multiple textfields 2 weeks 4 days ago #247921

  • Topic Author
  • mrperfectpz
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 326
  • Thanks: 0
Hi Tihana

That works perfect !!! How can I impliment that within this code so it uses the second select list 'Select2'
function ff_Select_action(element, action)
{

    
var val1=jQuery('[name="ff_nm_Select[]"]:checked').val();
var val2=jQuery('[name="ff_nm_Select2[]"]:not(:checked)').val();
var val3=jQuery('[name="ff_nm_AddValues[]"]:not(:checked)').val();
if(val1=val2)
{
jQuery('[value="'+val2+'"]').prop('checked', true);
jQuery('[value="'+val3+'"]').prop('checked', true);
}


let result = JQuery('input[name="'+JQuery(element).attr('name')+'"]:checked');

ff_getElementByName('ThisTest1').value=result.get(0).value; 
ff_getElementByName('ThisTest2').value=result.get(1).value; 
ff_getElementByName('ThisTest3').value=result.get(2).value; 
ff_getElementByName('Player4').value=result.get(3).value; 
ff_getElementByName('Player5').value=result.get(4).value; 
ff_getElementByName('Player6').value=result.get(5).value; 
ff_getElementByName('Player7').value=result.get(6).value; 
ff_getElementByName('Player8').value=result.get(7).value;                        
ff_getElementByName('Player9').value=result.get(8).value; 
ff_getElementByName('Player10').value=result.get(9).value; 
ff_getElementByName('Player11').value=result.get(10).value; 
ff_getElementByName('Playe12').value=result.get(11).value; 
ff_getElementByName('Player13').value=result.get(12).value; 
ff_getElementByName('Player14').value=result.get(13).value; 
ff_getElementByName('Player15').value=result.get(14).value;

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

  • Page:
  • 1
  • 2
Time to create page: 0.050 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!