to set 'Option 1' checked you can
NWF$("#"+varControl).find("input[value='Option 1']")[0].checked=true
I am looking to reset values in the panel when another choice is selected.
you have to do 'reset' per every single control, there is no general function that would do it for all the controls in a panel.
since you named the topic "I want to reset the option button values" I provided an example for option buttons. if you need for another controls, please specify exactly what you need.
I have 3 panels with multiple option buttons in each panel. A single panel loads based on the value of the option button selected. But when the option button value is changed i want to reset the values option buttons in the panel.
I am using the below to reset the values to default value but i am unsuccessful
NWF$(document).ready(function(){Â
var obj = NWF$("#" +Choices);Â
obj.change(function(){
NWF$("#" + TextBox ).val('');
} );
} );
if you correctly set up javascript variables for your Chioces and TextBox controls your code should work.
do you get any error on developer console?
Can you help me with javascript set up as i am unable to move forward on this.
I am using the javascript in the form setting custom java script section and enabling the javascript client id to yes and providing the javascript variable to all the controls.
Thanks in advance.
that all sounds to be correct.
I've just taken your script and copy&paste it to my custom javascript (with no change).
then I placed a choice control on the form and configured javascript variable to 'Choices'
similarly I did for 'TextBox'
when I ran the form
and changed an choice option, text box got correctly cleared
Thanks for the help.
But I wanted it for the option box instead of text box.
And i figured it out and it all worked.
Thanks again for your support
you haven't written you need it for choice control in last post, I have understood it you refer to your code and that you have problems with clearing text box.
beside of that I have posted how to set an (default) option of choice control in my very first post.
consider marking a post that answered your question as an answer.
Hello
I am trying to implement the above solution for my case. but I am not having much success.
I have a choiceControl of 4 options whereby each option offers another 4 options:
When Supplier is selected then there is another choiceControl named [SupplierReason] available.
Same applies for Customer and the rest of other options.
I like to apply so when a user switches between the option, it should RESET the values.
Example: a user selects supplier and then select Supplier 2 ... however, he changes his mind and then select Customer and select Customer 2 instead. In the mean time, the already selected entries are not reset and therefore remain in field.
I am failing to understand how to nest this together?
 SupplierReason] has got 4 options and is shown when Supplier is selected.
 ÂCustomerReason] has got 4 options and is shown when Customer is selected
pFreightReason] is the main choice control (Supplier, Customer, Transport, Project, Internal).
Any help would be appreciated.
Anybody here can advise / help ... please?
I managed to find a solution.
Please refer to this link: https://support.nintex.com/SharePoint/Forms/Clearing_Values_from_Disabled_Choice_Control_with_JavaScript
In essence, I used this code to make it work
NWF$(document).ready(function()
{
var choice = NWF$("#" +FreightReason);
choice.change(function()
{
NWF$("#" + SupplierReason).find("input:radio").attr("checked",false);
NWF$("#" + CustomerReason).find("input:radio").attr("checked",false);
} );
} );