I know this question gets asked a lot and I have read through the other posts. My code still isn't working. I've tried every variation I've seen on here, using null instead of 0, using quotation marks, not using quotation marks, double equal signs, no double equal signs...what am I doing wrong? I'm really new to JavaScript so I'm not sure about the syntax stuff yet.
assessment.Questions.Questionset.Questiondetail.TFdetail.False_check::click - (JavaScript, client)
if(this.rawValue=="1")
{
xfa.form.assessment.Questions.Questionset.Questiondetail.TFdetail.True_check.rawValue="null";
}
assessment.Questions.Questionset.Questiondetail.TFdetail.True_check::click - (JavaScript, client)
if(this.rawValue=="1")
{
xfa.form.assessment.Questions.Questionset.Questiondetail.TFdetail.False_check.rawValue="null";
}
Solved! Go to Solution.
Views
Replies
Total Likes
Ok so you are checking the right value. Checkboxes are not mutually exclusive ...radioButtons are. You can change these objects over to RadioButtons and change the appearance of the Radio button to a square to make it look like a checkbox but behave like a radiobutton.
Can you share your form it woudl make it easier to debug.
Paul
Views
Replies
Total Likes
There doesn't seem to be anything wrong with your syntax. I would put an app.alert(this.rawValue) before the if condition to validate that the value you are testing is correct. Then to set something to null you do not put it in quotes. That woudl be the string null and not the value null. Why not set it to '"" an empty string? Lastly when testing the value in the if condition the 1 does not need to be in quotes.
Paul
Thanks for your help. However, it is still allowing me to check both boxes. I added the app.alert and the value is 1 when I check the box.
Here is the code I have now.
assessment.Questions.Questionset.Questiondetail.TFdetail.True_check::click - (JavaScript, client)
app.alert(this.rawValue)
if(this.rawValue==1)
{
xfa.form.assessment.Questions.Questionset.Questiondetail.TFdetail.False_check.rawValue="";
}
assessment.Questions.Questionset.Questiondetail.TFdetail.False_check::click - (JavaScript, client)
app.alert(this.rawValue)
if(this.rawValue==1)
{
xfa.form.assessment.Questions.Questionset.Questiondetail.TFdetail.True_check.rawValue="";
}
Do I need to put both boxes into their own subform together?
Views
Replies
Total Likes
Ok so you are checking the right value. Checkboxes are not mutually exclusive ...radioButtons are. You can change these objects over to RadioButtons and change the appearance of the Radio button to a square to make it look like a checkbox but behave like a radiobutton.
Can you share your form it woudl make it easier to debug.
Paul
Views
Replies
Total Likes
Thanks Paul!
I wanted to use the checkboxes because I liked the way the data returned better with a checkbox. But I changed them to radio buttons and now it works fine. However, now I am having issues with some of my other buttons. I'm going to post another topic since it's a "new" issue...maybe you can help with that.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies