DataAdmin Posted February 15, 2017 Report Share Posted February 15, 2017 Hi I've tried using this on my footer but it does not work. My datapage is a results page with inline edit set to yes. Below is my script: <SCRIPT LANGUAGE="JavaScript"> function setTime(){ var v_chk=document.getElementById('EditRecordConfirmed').checked; if(v_chk==true) { document.getElementById("EditRecordDateConfirmed").value="[@cbTimestamp]"; } } document.getElementById("caspioform").onsubmit=setTime; </SCRIPT> Thanks. Ivy Quote Link to comment Share on other sites More sharing options...
Mathilda Posted February 17, 2017 Report Share Posted February 17, 2017 On 2/14/2017 at 4:52 PM, DataAdmin said: Hi I've tried using this on my footer but it does not work. My datapage is a results page with inline edit set to yes. Below is my script: <SCRIPT LANGUAGE="JavaScript"> function setTime(){ var v_chk=document.getElementById('EditRecordConfirmed').checked; if(v_chk==true) { document.getElementById("EditRecordDateConfirmed").value="[@cbTimestamp]"; } } document.getElementById("caspioform").onsubmit=setTime; </SCRIPT> Thanks. Ivy Hi Ivy, As far as I know, we can't use java script in Inline edit mode. That's why I would recommend editing record on details page. That script should work on details page Quote Link to comment Share on other sites More sharing options...
DataAdmin Posted February 20, 2017 Author Report Share Posted February 20, 2017 On 2/17/2017 at 10:25 PM, Mathilda said: Hi Ivy, As far as I know, we can't use java script in Inline edit mode. That's why I would recommend editing record on details page. That script should work on details page Hi Mathilda, Thanks a lot for the reply. I tried testing all the possible scripts discussed in forum and it all did not work. And now I know the reason why. Your response is what I badly needed. Thanks heaps. Ivy Quote Link to comment Share on other sites More sharing options...
Mathilda Posted February 21, 2017 Report Share Posted February 21, 2017 On 2/19/2017 at 4:39 PM, DataAdmin said: Hi Mathilda, Thanks a lot for the reply. I tried testing all the possible scripts discussed in forum and it all did not work. And now I know the reason why. Your response is what I badly needed. Thanks heaps. Ivy Hi Ivy, I have good news for you I was able to make it to work with jquery. Wrap your fields in div with ID cbform-improvement. Also you need to disable ajax on your report and paste the following script in the footer: <script> $("#cbform-improvement #Mod0InlineEdit").click(function(e){ var chkbx_before = "[@field:Field_name^]"; var chkbx_now = $("[name=InlineEditField_name]").is(':checked'); if(chkbx_before!="Yes"){ if(chkbx_now){ var timestamp = '[@cbTimestamp]'; $("[name=InlineEditField_for_date]").val(timestamp); } else { var timestamp = ''; $("[name=InlineEditField_for_date]").val(timestamp); } } }); </script> Don't forget to paste your field names. Quote Link to comment Share on other sites More sharing options...
georgep Posted March 12, 2017 Report Share Posted March 12, 2017 Mathilda I am also keen to use some JS to concatenate two fields within an inline edit. Tried using your script with some changes and not able to get it to work. Could not even get an alert to fire so something is way wrong. Was wondering re the div wrapping. Am I able to put those in the Header and Footer? Any help you can give would be v gratwefully appreciated. George My alert testing script was: <script> $("#cbform-improvement #Mod0InlineEdit").click(function(e){ alert ('hello'); } ) </script> ------------------------------- The actual script I would like to use is: Where "TP_Applications_Outcome" is the result of a cascading dropdown. "TP_Applications_Internal_Notes" is a text Area field holding just text for di0laying in html i.e. with tags on details screens. <script> $("#cbform-improvement #Mod0InlineEdit").click(function(e){ var outcome = $("[name=InlineEditTP_Applications_Outcome]").value; var notes1 = "[@field:TP_Applications_Internal_Notes]"; var auth= "[@authfield:Username]"; var notes2 = "(" + auth + ")" + " Stage Changed to: <b>" + outcome + "</b><br><br>" + notes1; $("[@field:TP_Applications_Internal_Notes]").val(notes2); } ) </script> Quote Link to comment Share on other sites More sharing options...
Meekeee Posted July 29, 2019 Report Share Posted July 29, 2019 You may also check this article for a similar workflow: I hope it helps! 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.