howto reset data inside a Section via a select-group

  • Posts: 19
  • Thank you received: 0

rd replied the topic: howto reset data inside a Section via a select-group

Hello Mihaela,

in your last post you wrote:

If you want to uncheck all radio group options, use this code:
jQuery('[name="ff_nm_radiogroup[]"]:checked').prop("checked", false);


This is working good, the radio group options are beeing unchecked.

Question:
We have to put checkbox group option to NO. Imagine a radio group with 2 states: "visible" / "unvisible". With the code above they are both unchecked.
Now we have some other checkbox groups that has to be set to "unvisible".

How can we do that?
Thank you again
Rolf
#233744
  • Posts: 1740
  • Karma: 62
  • Thank you received: 217

mihaela replied the topic: howto reset data inside a Section via a select-group

Hello again,

Her is how you can make the certain checkbox in checkbox group checked.

First, uncheck all checkboxes in that "Checkbox group" with this code:
opts =  JQuery("[name=\"ff_nm_checkboxgroupname[]\"]");

Then with this line of code check certain option:
JQuery("#"+opts[1].id+"").attr("checked", true);
This will mark the second option in checkbox group because of opts[1] . To select first option, for example, put there opts[1].

Let me know whether this is what you wanted to achieve and whether it works as you wanted.

Regards,

Mihaela
#233759
  • Posts: 19
  • Thank you received: 0

rd replied the topic: howto reset data inside a Section via a select-group

that's working perfectly, thank you again, Mihaela.

But how can we combine these two functions
1) reseting everything inside a section to state "nothing is selected"
plus this new code:
2) Put the redio group that toggles the a) visibility and b) the content of the beneath laying content to the state "not selected"

This is the situation:
  • 3 sections A, B and C
  • each section has its own content like radio groups, check boxes, text fields.
  • the 3 sections are initially set to "invisible"
  • there are 3 Radio groups, for each section one. they toggle a) the visibility of each group and b) they reset the content of the not selected section. The inital state of each radio group is "section not visible"
So if Section A is set to "visible, section A is shown, B and C are set to invisible and all content of B and C is set to "nothing selected"
The same with B. If B=Visible, C and A are set to invisible and all formerly added content is beeing reseted. And so on with C.

I am not sure, if I am able to explain the situation clearly. Maybe it helps to have a look at the form:

File Attachment:

File Name: FomulareHMV2.xml.zip
File Size:16 KB


Looking forward hearing from you
Rolf
#233768
Attachments:
  • Posts: 1740
  • Karma: 62
  • Thank you received: 217

mihaela replied the topic: howto reset data inside a Section via a select-group

Hello,

So if I understood correctly, you have successfully set up the hiding and showing sections.
Now you want to know how to add code to empty the fields from other sections. For example, that all content of B and C is set to "nothing selected" when "Schalter_Rolladen_vorhanden" is set to "Ja". Is that correct.

If it is, you can't reset tho whole section, but you have to write the code for each element as suggested in previous posts.

For example, for "Schalter_Rolladen_vorhanden" element the code would go like this:
function ff_Schalter_Rolladen_vorhanden_action(element, action)
{
if(jQuery('[name="ff_nm_Schalter_Rolladen_vorhanden[]"]:checked').val()  == "Ja")
{ 
  opts =  JQuery("[name=\"ff_nm_Schalter_Zipscreen_vorhanden[]\"]");
  JQuery("#"+opts[1].id+"").attr("checked", true);
  opts =  JQuery("[name=\"ff_nm_Schalter_Raffstore_vorhanden[]\"]");
  JQuery("#"+opts[1].id+"").attr("checked", true);
  }

// put here the code to rest the wanted fields
ff_getElementByName('bfQuickMode29892').value = "";
// etc.
} // ff_Schalter_Rolladen_vorhanden_action

Let me know whether you understand how you need to set this and whether you've managed to set this to work as you wanted.

Regards,

Mihaela
#233802
The following user(s) said Thank You: rd, MarioPuco
  • Posts: 19
  • Thank you received: 0

rd replied the topic: howto reset data inside a Section via a select-group

That's it -- Wonderful
Mihaela, your support is just amazing!
Again, Thank you very much!
#233821
  • Posts: 1740
  • Karma: 62
  • Thank you received: 217

mihaela replied the topic: howto reset data inside a Section via a select-group

Hello again,

Thank you for the kind words. :)

I'm glad that I've helped and that it is working as you wanted.

Regards,

Mihaela
#233838
Moderators: ForumSupporttomeperica
Time to create page: 0.070 seconds

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99€

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

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!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here