[SOLVED] Element Javascript - update value Radiobutton Element

Status
Not open for further replies.

marcq

Member
Hi,

I've created two radiobutton Elements :

- blocked (to block or not the user access)
- status (Membre actif, Ancien membre)

In my "status" element javascript, i've got the following script which is triggered when value change from "2" to "3" ("2" = Membre actif, "3" = Ancien membre)


PHP:
if (this.get('value') == '3') {
    if (!confirm("?tes-vous certain de vouloir muter ce membre en "ancien membre" ?\n\nSi c'est le cas :\n\n1. Veuillez confirmer ce message\n2. Saisir la date de desinscription et\n3. Bloquer ce membre.")) {
    this.update('2');
 
  }
}


This works well, confirmation message is displayed.

Now I would also like the "blocked" element being update to "1" ("0" = unblocked, "1" = blocked), wenn this script is triggered.

I tried to insert the following line into my script, but it doesn't work.

Code:
form_3.formElements.get('gprh_fabrik_user_registration___user_block').update('1');

How can I do this.

Thanks in advance for you tips,

Marc
 
Hmmm, that should work, assuming you have set up the form_3 variable? Just to be sure, try ...

Code:
Fabrik.getBlock('form_3').formElements.get('gprh_fabrik_user_registration___user_block').update('1');

-- hugh
 
Hi Hugh, thanks for your reply and sorry for my response delay.
And it works perfectly ! Again great support, thanks a lot Hugh, cheers, Marc

Solution to my issue :

Code:
if (this.get('value') == '3') {
  if (!confirm("?tes-vous certain de vouloir muter ce membre en ancien membre ?\n\nSi c'est le cas :\n\n1. Veuillez confirmer ce message\n2. Saisir la date de desinscription.")) {
    this.update('2');
  }
}
Fabrik.getBlock('form_3').formElements.get('gprh_fabrik_user_registration___user_block').update('1');
 
if (this.get('value') == '2') {
  if (!confirm("?tes-vous certain de vouloir muter ce membre en membre actif ?\n\nSi c'est le cas :\n\n1. Veuillez confirmer ce message\n2. Modifier la date d'adh?sion.")) {
    this.update('2');
  }
}
Fabrik.getBlock('form_3').formElements.get('gprh_fabrik_user_registration___user_block').update('0');
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top