(Updated)
Upon reviewing everything, the data is being stored properly when I change the type from checkbox to text, so I think it is about the way I am saving the checkbox data.
(picture below should have a row under language for Online Booking, and it does not.)
I am creating my first web app landing page in ACC and while I have all of my text input fields working, I am struggling to get the checkboxes to relay the data I want.
In the HTML, I have set the values - if checked - to be = 1
I was also looking into a data transfer issue, but the variables used in the web app, the HTML and data schema all line up:
Any help would be greatly appreciated.
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hello @bryceh57660644
If you to store the checkbox value and treat it as a boolean then here is the code
HTML
<input type="checkbox" id="agree" label="agree">
JS
if(document.getElementById('agree').checked){
document.controller.setValue('/ctx/vars/CHECKBOX_VARIABLE',"true");
} else{
document.controller.setValue('/ctx/vars/CHECKBOX_VARIABLE',"false");
}
Let me know if that helps
Views
Replies
Total Likes
Hello @bryceh57660644
Are you trying to preload the data and have the checkbox checked automatically with the variable data?
If yes, What you can do is
<input type="checkbox" name="name" <% if(ctx.vars.VARIABLE_NAME =='YOUR_VALUE' ) { %>checked <% } %>>
Views
Replies
Total Likes
Views
Replies
Total Likes
@_Manoj_Kumar_ no I am looking to have the recipient check the box of the service they are interested in. Once they check the items they are interested in, and hit submit, I want the form to submit a Yes or 1 response to the data schema. I have the fields as type="boolean" at the moment.
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Hello @bryceh57660644
If you to store the checkbox value and treat it as a boolean then here is the code
HTML
<input type="checkbox" id="agree" label="agree">
JS
if(document.getElementById('agree').checked){
document.controller.setValue('/ctx/vars/CHECKBOX_VARIABLE',"true");
} else{
document.controller.setValue('/ctx/vars/CHECKBOX_VARIABLE',"false");
}
Let me know if that helps
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies