Skip to main content
Participant
July 5, 2016
Question

Changing checkbox's false export value

  • July 5, 2016
  • 2 replies
  • 698 views

Hi,

I know nothing about javascript but have managed to teach myself enough to get through making some forms at work.  I have managed to make the form submit and design an email (there may have been a simpler way, but I just did it any way I could figure out how to).  But I have it so in the email, if a checkbox is ticked, it says Elec.  But at the moment if it is not checked it has Off written in place.  Is there a way to change the false export value (Don't know if I'm even calling it the right thing?)

Please also don't come back with a whole lot of technical terms, as I seriously don't understand any of it   sorry to be a pain! - I have also added a photo of what my email looks like.  I have filled some of it out to show what I want happening.

The Javascript I ended up with is

I really hope someone can help me!  Thanks and sorry I'm confusing!

This topic has been closed for replies.

2 replies

Legend
July 5, 2016

The value of "unchecked" of a checkbox or radiobutton is "Off". This can not be changed.

What can be done in the situation where the return value of the checkbox/radiobutton is included in a string, is changing it on the fly when assembling the string.

We can for that use the replace() method, as in (assuming the return value would be "checked".

app.alert = "I am " + this.getField("myCheckBox").value.replace(/Off/, "unchecked") + "." ;

Hope this can help.

try67
Community Expert
Community Expert
July 5, 2016

It's not possible.