[SOLVED] Radiobutton - Change value confirmation message

marcq

Member
Hi,

I have created a form with among others a Radiobutton field with 3 options :

1 = Prospect
2 = Member
3 = Unsuscribe

I need the user to confirm if he changes value from "2 - Member" to "3 - Unsuscribe".

A message should be displayed, when user is clicking value "3 - Unsuscribe". Message that he should confirm with "Ok".

Does someone know how I could do this ?

Thanks in advance for your tips.

Cheers,


Marc
 
Should be do-able with a little Javascript on the element.

http://screencast.com/t/DdFds2zAN

So the code for your 'click' event is:

Code:
if (this.get('value') == '3') {
   if (!confirm("Are you sure?")) {
     this.update('2');
   }
}

NOTE - this will also run if they change from 1 to 3, and will reset the element to 2. This is unavoidable, as we don;t know what the value was they changed from, only the new value.

-- hugh
 
Should be do-able with a little Javascript on the element.
http://screencast.com/t/DdFds2zAN

So the code for your 'click' event is:

Code:
[/FONT]
[FONT=arial]if (this.get('value') == '3') {[/FONT]
[FONT=arial]  if (!confirm("Are you sure?")) {[/FONT]
[FONT=arial]    this.update('2');[/FONT]
[FONT=arial]  }[/FONT]
[FONT=arial]}[/FONT]
[FONT=arial]

NOTE - this will also run if they change from 1 to 3, and will reset the element to 2. This is unavoidable, as we don;t know what the value was they changed from, only the new value.

-- hugh



Thanks a lot for your reply and solution Hugh, It works well, issue solved ! Cheers Marc
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top