javascript for adobe acrobat form -
trying write script adobe acrobat xi form when user selects checkbox7 field should display value of 239 , if unchecked shows value of 0 have set mouse (is correct?) below code:
var checkbox7value = this.getfield("checkbox7"); if (checkbox7value.isboxchecked(239)) var checkbox7value = 239 else var checkbox7value = 0
thanks in advance help!
what return value of checkbox? default "yes", or else?
however, code pretty messed up, must say…
in first line, define field object, linked field checkbox7
in second line test whether 239th widget/occurrence of field checked.
depending on result, redefine field object number.
anyways, assuming don't have many calculations, , dependencies, , return value of checkbox field indeed "yes", add following calculate event of field result shall appear:
if (this.getfield("checkbox7").value == "yes") { event.value = 239 ; } else { event.value = 0 ; }
now if know checking checkbox7 field mean "239", can set return value 239, , code becomes simpler:
event.value = this.getfield("checkbox7").valueasstring.replace(/off/gim, "0") ;
we have replace() because value "unchecked" "off" in checkbox/radiobutton.
Comments
Post a Comment