srufini Posted July 8, 2016 Report Share Posted July 8, 2016 Hello, In a result list of Action Items (todo) I want the user to just check a box and the items on the line of the checkbox changes its status to "In Approval". I used this code in an HTML block (repeated every line), but doesn't seem to work. <input id="doneCheck" type="checkbox" onclick="done();"> <script> function done() { if (document.getElementById('doneCheck').checked) { document.getElementById("InsertRecordStatus").value="In Approval"; } } </script> Any advise? Thanks Sergio Quote Link to comment Share on other sites More sharing options...
LWSChad Posted July 8, 2016 Report Share Posted July 8, 2016 Your ID "doneCheck" gets repeated every line so your script doesn't know which RecordStatus to update. Add a parameter to your ID so the IDs are different every line, you'll also need to use an HTML Block so you can modify the ID <input id="doneCheck[@RecordID]" type="checkbox" onclick="done();"> <script> function done() { if (document.getElementById('doneCheck[@RecordID]').checked) { document.getElementById("customHtmlBlock[@RecordID]").value="In Approval"; } } </script> All that being said, you might not be able to accomplish this unless each record is "editable". Typically reports display results that are not editable. Caspio does offer a "grid edit" option, but I haven't played with that much Hope This helps Quote Link to comment Share on other sites More sharing options...
srufini Posted July 11, 2016 Author Report Share Posted July 11, 2016 Hi EIQ, thanks for your answer. Indeed I forgot to consider that index must change. But is not clear to me what is the use of the HTML Block. What I want to modify, in case the checkbox is checked, is the field "Status". And unfortunately still cannot manage, maybe as you said caspio doesn't let me modify fields that are in the table results.... Quote Link to comment Share on other sites More sharing options...
LWSChad Posted July 11, 2016 Report Share Posted July 11, 2016 Did you try a grid edit? On the Search and Report Wizard - Results Page Editing Options Quote Link to comment Share on other sites More sharing options...
srufini Posted July 11, 2016 Author Report Share Posted July 11, 2016 Yep, no luck. Quote Link to comment Share on other sites More sharing options...
MayMusic Posted July 11, 2016 Report Share Posted July 11, 2016 As I understand you have a report page and you have bulk edit enabled. When user checks a box you want to change status, so what you can do is to change the form element of this field to checkbox in " Configure Fields for Bulk Edit " and then for " Value when checked " have " In Approval ". There is no need for coding this way Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.