AnsweredAssumed Answered

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

Question asked by stahanow on Apr 19, 2016
Latest reply on Apr 20, 2016 by stahanow

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

Outcomes