Getting Check Box Values via Jscript

R

rigsjc

Hello,

Please help an InfoPath 2003 newbie... I have a group of check boxes
on a form that I need to determine which boxes have been checked
(selected). Can someone provide me a Jscript example of how I would
determine that? Please help.

Thanks,
-Joe
 
S

S.Y.M. Wong-A-Ton

Why do you want to use JScript? You can do it with rules. If you still want
to use code, a checkbox is a field just like any other field. You can use
XDocument.selectSingleNode to retrieve a field's value. Do a search in this
newsgroup on selectSingleNode; you should be able to find many samples.
 
C

Cristina

Hi, sorry to bother you.
I have to change the value of a checkbox via jscript. I tried this way but
it is not working:
pagebr3 =
XDocument.DOM.selectSingleNode("my:myFields/my:Definire_Certificat_Urbanism/my:pagebreak3");
// if condition true => checkox.value=true
if ("...."){
pagebr3.text = 1;
}
 
S

S.Y.M. Wong-A-Ton

Double-check via the properties dialog box for the checkbox what the value
when cleared and checked should be (1/0 or TRUE/FALSE). If it is 1/0,
double-check whether you've got the right node (XPath expression). Tip: In
InfoPath, right-click on the checkbox, and change it into a textbox. Try
setting the value through code. Once you've got that working, change it back
to a checkbox.
 
C

Cristina

Thanks. It worked!

S.Y.M. Wong-A-Ton said:
Double-check via the properties dialog box for the checkbox what the value
when cleared and checked should be (1/0 or TRUE/FALSE). If it is 1/0,
double-check whether you've got the right node (XPath expression). Tip: In
InfoPath, right-click on the checkbox, and change it into a textbox. Try
setting the value through code. Once you've got that working, change it back
to a checkbox.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top