Skip to main content
Nintex Community Menu Bar
Answer

Set value of textbox with checkbox

  • February 26, 2020
  • 7 replies
  • 224 views

yuri

I have the following:

 

Checkbox named chkBox

Textbox namded txtBox. It has default value of 0.

I need to put new value (1,2,3,etc.) in the textbox when I click the checkbox.

I not expert in javascript and having very much difficulty in making this work.

Any help is greatly appreciated.

Yuri

 

 

 

 

 

Best answer by CarmScaffidi

This solution posted by Simon Muntz looks like an ideal exmple for you get an idea on how to use JavaScript in the Classic Form. 

 

https://community.nintex.com/t5/Nintex-for-SharePoint/Nintex-Forms-If-Box-is-Checked-Clear-Associated-Number-Fields-to/m-p/100806#M70005

7 replies

Forum|alt.badge.img+9
  • February 26, 2020

No Javascript required. Just use the New Responsive Designer to create 3 rules corresponding to all the values in the chkBox and sets the corresponding value in your txtBox.

 

Attached is the example in the form and 3 rules.


yuri
  • Author
  • February 27, 2020

I am sorry. I should have said that this is a Classic form.


CarmScaffidi
Forum|alt.badge.img+2

What you are trying to do is very straight forward in JavaScript, I would suggest you spend some time over at https://www.w3schools.com/js/default.asp so you will see for yourself how easy it is.


yuri
  • Author
  • February 27, 2020

Thank you for your response. I will  employ your suggestion but I need to solve this problem most quickly.

Yuri


CarmScaffidi
Forum|alt.badge.img+2

A hint for you to help get you started quicker :-)  You can also try JavaScript within that location so you can quickly see if what you coded works or not. 

 

Good luck!

 

https://www.w3schools.com/howto/howto_js_display_checkbox_text.asp


CarmScaffidi
Forum|alt.badge.img+2
  • Answer
  • February 27, 2020

This solution posted by Simon Muntz looks like an ideal exmple for you get an idea on how to use JavaScript in the Classic Form. 

 

https://community.nintex.com/t5/Nintex-for-SharePoint/Nintex-Forms-If-Box-is-Checked-Clear-Associated-Number-Fields-to/m-p/100806#M70005


yuri
  • Author
  • February 27, 2020

Thank you for your kindness. I will try the example.

Yuri