TOPIC:

Read only field by condition 3 weeks 4 days ago #278776

  • Luisserafim's Avatar Topic Author
  • Luisserafim
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 274
  • Thanks: 1
Hi,

We need that

if field 1 = 1

then

field 2 = read only

Can we do this?

Tx in advance

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

Read only field by condition 3 weeks 4 days ago #278777

  • Mirec's Avatar
  • Mirec
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 3264
  • Karma: 2
  • Thanks: 160
Hi,

I think yes, I need to test it and then I will let you know


regards,
Mirko

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

Read only field by condition 3 weeks 4 days ago #278779

  • Mirec's Avatar
  • Mirec
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 3264
  • Karma: 2
  • Thanks: 160
Hi,

soluction!

in the advance of the element in the section action script select custom and type' change' and add this following code :
function ff_a_action(element, action)
{
    switch (action) {
        case 'change':

if (element.value == 1){

jQuery('#ff_elem19392').prop('readonly', true);


}else
jQuery('#ff_elem19392').prop('readonly', false);



            break;
        default:;
    } // switch
} // ff_a_action


Instead 'ff_elem19392' add the ID of the element for which you want it to be read only.

I didn't explain the rest of the code, because I suppose that you know what you need to change to the code works.

Let me know!

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

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

Read only field by condition 3 weeks 4 days ago #278781

  • Luisserafim's Avatar Topic Author
  • Luisserafim
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 274
  • Thanks: 1
Hi Mirko,

Sorry, I don't know if I am in the wright forum...

This is for Content Builder.

Tx in advance

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

Read only field by condition 3 weeks 4 days ago #278782

  • Mirec's Avatar
  • Mirec
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 3264
  • Karma: 2
  • Thanks: 160
Hi,

oke, no problem, I will test it for CB and then provide you solution

Regards,
Mirko

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

Read only field by condition 3 weeks 4 days ago #278783

  • Mirec's Avatar
  • Mirec
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 3264
  • Karma: 2
  • Thanks: 160
Hi,

insert in the Init (Java script) this code
jQuery( '#cb_19276' ).change(function() {

if(jQuery( '#cb_19276' ).val() == 1){

jQuery('#cb_19277').prop('readonly', true);

}else
jQuery('#cb_19277').prop('readonly', false);


});

cb_19276 - id of the element where is value 1

cb_19277 - id of the element which is redonly

Let me know if is oke!

Regards,
Mirko

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

Time to create page: 0.045 seconds

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

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!