• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Radio Button - Condition field - Clear field

Radio Button - Condition field - Clear field 10 years 6 days ago #27251

  • berd
  • berd's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 1
Hi,

I have the following setup.

A field called: Do you have a licence: with the radio buttons YES and NO
When activating YES some fields are showing because of the Condition field i have set.
(Show License - if radio button is YES)

The customer can fill in some fields, but when he decided to press the radio button to NO, i want all the fields to be cleared and set to dfault value.

So how can i set the radio button NO to reset alle the fields activated true a condition value?

--Cheers--
BerD
The administrator has disabled public write access.

Radio Button - Condition field - Clear field 10 years 6 days ago #27256

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Radio Button - Condition field - Clear field 10 years 6 days ago #27258

  • berd
  • berd's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 1
Hi,

Yes I did and i have been tried to activate this but i did not get it running yet. I am not a programmer and i have been reading the comment but i am not sure where to put it and the names of the fields.
Can you explain me how to use it?
I have set up a simpel form on which i have been playing arround
test form
When pressing Yes and then C there is a discount field which needs to be cleared when prssing the radio button to No.

--Berd--
The administrator has disabled public write access.

Radio Button - Condition field - Clear field 10 years 5 days ago #27263

  • berd
  • berd's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 1
Hi,

I have get all the way to the basic, just created a simple form with 2 textboxes which will shown with a radio condition field.

I have used and put the follwing php code in [Script called on form display]
if ($_POST['form']['selection'] == 'boats')
{
  $_POST['form']['car'] = '';
}

The form is here: Example form

What am I doing wrong here?

BerD
The administrator has disabled public write access.
The following user(s) said Thank You: BrentC

Radio Button - Condition field - Clear field 10 years 2 days ago #27285

  • berd
  • berd's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 1
I've tried everything and I slowly go crazy ..... Is there any body who can explain me in basic simple words how I can solve this?
The administrator has disabled public write access.

Radio Button - Condition field - Clear field 9 years 5 months ago #29371

  • sales447
  • sales447's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
Same problem, did you solve this?
The administrator has disabled public write access.

Radio Button - Condition field - Clear field 9 years 5 months ago #29394

  • cosmin.cristea
  • cosmin.cristea's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
  • Thank you received: 144
PHP scripts occur server-side, you are looking for a solution that occurs in your submitter's window. For this you will need Javascript. You will have to use the CSS and Javascript section of RSForm!Pro and create a script that grabs first fields value:
var first = document.getElementById('first_field');
var second = document.getElementById('second_field');

create a condition :
if (first.value == "boat"){
  second.value = "";
}	


wrap it all in a function:
function myFunction(){
var first = document.getElementById('first_field');
var second = document.getElementById('second_field');
 
  if (first.value == "boat"){
    second.value = ""
  }	
}

and place it as a trigger in first field onblur="myFunction()";

PS: This is only an example, you will need to build on this to achieve your scenario.
My help is not official customer support. To receive your support, submit a ticket by clicking here
Last Edit: 9 years 5 months ago by cosmin.cristea.
The administrator has disabled public write access.

Radio Button - Condition field - Clear field 6 years 1 month ago #37981

  • info0657
  • info0657's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
Hello,

Me to I'm going crazy with this.

I have a form using conditional fields.

Then other sub-conditional fields.
If a user selects a conditional field and then selects something but deselects the conditional field or selets another option that shows other fields... the values of the fields that should be hidden are not reset.

The e-mails are submitted with all of the selected options. They show the answers from selected conditional fields but also from unselected conditional fields, those hidden that were previously selected so as if the user changed his mind and selected someting else.

I searched in this forum and found 2 sililar posts:

www.rsjoomla.com/forum/37-rsform-pro/259...on-change.html#31860
And
www.rsjoomla.com/forum/37-rsform-pro/191...en-fields.html#19155
I tried to go through the posted solution:
www.rsjoomla.com/support/documentation/r...p-email-scripts.html

But this was not very clear concerning my issue. it's useful on how to hide unselected but does not say how to clear unselected conditional fields.

How can I clear conditional fields whose triggering field is not selected AND hide any field (label and value) that's not selected in the e-mails?
Can anyone help me on getting this sorted out?

And leave the solution here so everyone else can see it!

I wrote to RS Form Pro support, they dont seem to be very concerned about it. Their answer was:
"Unfortunately the Conditional Fields functionality does not reset the field's value when the selection is changed. This can be achieved only through custom scripting and you can use the "CSS&Javascript" section of your form in order to create a script that resets the field value based on user's selection. Note that after resetting the field value you will have to trigger again the calculation function. Example:

rsfp_runAllConditions32();

..where 32 must be replaced with your form id.

Unfortunately at the current moment, we do not have any examples on this specific topic and we do not offer customization for our products."
The administrator has disabled public write access.

Radio Button - Condition field - Clear field 6 years 1 month ago #37983

  • octavian
  • octavian's Avatar
  • NOW ONLINE
  • RSJoomla! Official Staff
  • Posts: 783
  • Thank you received: 110
Actually, we are concerned about it, since we've released 2.0.7 with this improvement :)
www.rsjoomla.com/support/documentation/r...m-pro/changelog.html
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Radio Button - Condition field - Clear field 6 years 1 month ago #37984

  • info0657
  • info0657's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
Hello, that's good news...

But if your colleague in support just told me that that issue was to be solved in a release comming in a few days....

I would not have spent hours trying to figure out some scripting

And I would not have paid a freelance developper to do the javascript that should be delivered... today! same day as your release.

Thanks anyway
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!