Skip to main content
Known Participant
February 6, 2016
Question

Clear text box

  • February 6, 2016
  • 1 reply
  • 478 views

When selecting a checkbox I want to export the data to a text box. I have this code.

Trigger: Mouse Up

Action: Run a JavaScript

var one = this.getField("Check Box2");

var two = this.getField("Text6");

{two.value=one.value}

When clicked it puts the export data from Check Box2 into Text6. However, if I want to change my selection, it will not allow the new export data to be exported into Text6 as it already has the data from the previous selection in it. Any help on the code to clear Text6 before a selection is made in Check Box2 would be much appreciated.

This topic has been closed for replies.

1 reply

Inspiring
February 6, 2016

Is that code in the Mouse Up event of the "Check Box2" check box, or some other one?

senechiaAuthor
Known Participant
February 6, 2016

I actually put the code in the custom calculation script of Text6, and it works. However, I have discovered another problem. If the Checkbox is off, I get the default value "Off" in Text6, Can I change this default value of "Off" to something else?