Not applicable

Nintex Forms - Reset radiobutton-type Choice control value with Javascript

Hello!

I want to clear the values of the hidden controls, controlled by some other control values, but when I want to reset a Radio button type Choice control value, I just can't do it... I tried to uncheck the items, set the value, nothing helped me.

My code:

function clearHiddenControls(source, arguments)

{

var appleName = NWF$('#' + varAppleName);

var appleSum = NWF$('#' + varAppleSum);

var bananaName = NWF$('#' + varBananaName);

var bananaSum = NWF$('#' + varBananaSum);

var fruitType = NWF$('#' + varTestFruit);

var bananaType = NWF$('#' + varBananaType); //this is the choice control, what I want to uncheck everything.

var bananaSubtype = NWF$('#' + varBananaSubtype);

if (fruitType.find('input:checked').val() == 'Test an Apple'){

bananaName.val('');

bananaSum.val('');

bananaSubtype.val('');

bananaType.val(''); //not working solution, the .text('') just removed all my choices, unchecking each elements also not working.

}

else if (fruitType.find('input:checked').val() == 'Test a Banana'){

appleName.val('');

appleSum.val('');

}

arguments.IsValid = true;

}

Btw, is there a better method to clear all hidden values? The reason why I want to do this, that Nintex Forms saves hidden control values, so if someone type some text to these controls, then hide it, the value is still there, so it will be in the list items. I don't want to save useless texts, choices and etc. etc...

I also tried this with rules, tried to disable And hide the controls, nothing changed. Pls help!

Sorry for my bad english.

Thanks in advance!

Sincerely: StahanoW

0 Kudos
Reply
7 Replies
Not applicable

Re: Nintex Forms - Reset radiobutton-type Choice control value with Javascript

Okay, finally I figured out how can I do this without custom builded logics. I founded another way, to detect visibility changes, and change the radiobutton type checkbox value. Here's the sample code:

var appleName = NWF$('#' + varAppleName);

var appleSum = NWF$('#' + varAppleSum);

var bananaName = NWF$('#' + varBananaName);

var bananaSum = NWF$('#' + varBananaSum);

var fruitType = NWF$('#' + varTestFruit);

var bananaType = NWF$('#' + varBananaType);

var bananaSubtype = NWF$('#' + varBananaSubtype);

NWF$(document).change(function(){

if (appleName.is(':visible') == false){

  appleName.val('');

}

if (appleSum.is(':visible') == false){

  appleSum.val('');

}

if (bananaName.is(':visible') == false){

bananaName.val('');

}

if (bananaSum.is(':visible') == false){

bananaSum.val('');

}

if (bananaType.is(':visible') == false){

bananaType.find('input:checked').attr('checked',false);

}

if (bananaSubtype.is(':visible') == false){

bananaSubtype.val('');

}

});

Connected with a Calculated value will show that nothing changed, but at the background, changes are applied, and the choices are all unchecked

Reply
BigBlockChevy

Re: Nintex Forms - Reset radiobutton-type Choice control value with Javascript

This worked like a charm 

Thank you 

0 Kudos
Reply
Kasey00
Novice

Re: Nintex Forms - Reset radiobutton-type Choice control value with Javascript

@https://scrabblewordfinder.vip/ This worked with such great transparency. Thank you!

0 Kudos
Reply
Aviyo1
Rookie

Re: Nintex Forms - Reset radiobutton-type Choice control value with Javascript

Its really helpful information

0 Kudos
Reply
desinysbeauty
Novice

Re: Nintex Forms - Reset radiobutton-type Choice control value with Javascript

@https://geometrydash-free.com I have two radio buttons in an HTML form. A dialog box appears when one of the fields is null. How do I check if the radio button is selected?

0 Kudos
Reply
Aviyo1
Rookie

Re: Nintex Forms - Reset radiobutton-type Choice control value with Javascript

A dialog box appears when one of the fields is null. How do I check if the radio button is selected?  framaroot apk

0 Kudos
Reply
lensemark73
Novice

Re: Nintex Forms - Reset radiobutton-type Choice control value with Javascript

I also couldn't figure out for a long time how the button should appear in the HTML code. Several times there was a similar situation at the aspen dental service center when I tried to contact them at the aspen dental phone number. The button was moving and I could not press it. But now they fixed it when I contacted them all the same and reported.

0 Kudos
Reply