Accountability
Caspio Ninja-
Posts
78 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Accountability's Achievements
Newbie (1/14)
1
Reputation
-
I Have the exact same need only I have three separate datapages using three different tables all on the same web page. Do I just hide all three "Submit" buttons from the styles CCS and then add the following to the footer of the last datapage on the page : <script type="text/javascript"> document.addEventListener('DataPageReady', function () { document.querySelectorAll('td[class^="cbSubmitButtonContainer"').forEach(function(i) { i.style.display = "none"; }); }); </script> And can I add the following to anyone of the three datapages or does it have to be on the last datapage? <button id="submitAll">Submit</button> <script> document.getElementById('submitAll').addEventListener('click', function() { var arr = Array.from(document.querySelectorAll('td[class^="cbSubmitButton"]>input')) arr.forEach(function(elem){ console.log(elem); elem.click(); }); }); </script> One last thing, if any one of the datapages has a required field not populated, will it work as if I only had one datapage with one submission? In other words, will it reject the submission of all three and highlight the required field not highlighted. Thanks for your help.
-
Hide and/or Show Document Icons
Accountability replied to Accountability's topic in User JavaScript and CSS Discussions
Really appreciate you making the effort. Unfortunately didn't hide either one. This is an HTML block in a report results page. Thanks again for helping... -
Hide and/or Show Document Icons
Accountability replied to Accountability's topic in User JavaScript and CSS Discussions
First of all thanks for responding. [@field:Employee_Document_Link] is a text255 and [@field:Employee_Document_Upload] is a file. -
Hide and/or Show Document Icons
Accountability posted a topic in User JavaScript and CSS Discussions
Contained in this HTML block are two options:Google Doc<br /> <a href="[@field:Employee_Document_Link]" target="_blank"><img alt="File Quick View" src="http://account-ability.net/webapps/hca/images/Entypo_e731(1)_32.png" style="width: 32px; height: 32px;" /></a><br /><br />Uploaded Doc<br /> <a href="https://c0axa147.caspio.com/dp/76292000e18ad3e841834930b209?Employee_Document_ID=[@field:Employee_Document_ID]" target="_blank"><img alt="File Quick View" src="http://account-ability.net/webapps/hca/images/Entypo_e731(1)_32.png" style="width: 32px; height: 32px;" /></a>The user clicks on either of the document icons. What I am trying to achieve is for the "Google Doc" icon to show only when the [@field:Employee_Document_Link] is not empty the and "Uploaded Doc" icon to only show when the [@field:Employee_Document_Upload] is not empty. Would very much appreciate any help in this. -
Took me a while to figure out. Here is what worked for me if anyone else needs it. <script> var now = new Date(); var expiration = new Date("[@field:Employee_Doc_Date_Plus_Renew*]"); if(now > expiration) // today is after expiration document.write("<IMG ALIGN='center' "+ "SRC='https://My URL/Expired_76x50.png'> "); </script> You will need to replace My URL with the actual URL where your image resides as well as your actual @field references.
-
I have a field [@field:Expiration_Date] . I would like to display a small 75 x 50 graphic "Expired" using JavaScript in an Html Block only if Today() is greater than the expiration date. This is a results page where rules are not available. I am pretty sure this can be done with an <img> tag, JavaScript and an Html Block. I just don't know the proper syntax. Would appreciate any help ? Thanks You ! Unsuccessfully Tried This: <script> expired = [@field:Employee_Doc_Date_Plus_Renew*].value; today=[@field:Date_Time_Stamp*].value; if (expired < today) { <img alt="" src="https://www.mysite.net/Expired_76x50.png" style="width: 76px; height: 50px;" /> ; } </script>
-
Validate Date and Time
Accountability replied to Accountability's topic in User JavaScript and CSS Discussions
Hello Douvega, Many Many Thanks. You are incredible, worked perfectly. THANK YOU, THANK YOU, THANK YOU... -
Accountability reacted to a post in a topic: Validate Date and Time
-
Validate Date and Time
Accountability replied to Accountability's topic in User JavaScript and CSS Discussions
Hello Vitalikssssss, Thanks again for responding. Unfortunately, this does not work. It is really strange because it is such a simple script and with the limited knowledge I have in regards to Javascript, it appears to be flawless. I am really scratching my head on this one. Thanks again. -
Validate Date and Time
Accountability replied to Accountability's topic in User JavaScript and CSS Discussions
Also unsuccessfully tried this: <div id="datefix"> <script> function DateCheck() { var dateout = document.getElementById('InsertRecordDefined_Time_Out').value; var datein = document.getElementById('InsertRecordDefined_Time_In').value; var zero = "00/00/0000" if (dateout <= datein) alert("Please enter a date and time OUT after date and time IN "); document.getElementById("InsertRecordDefined_Time_Out").value = "zero"; return false; } document.getElementById('InsertRecordDefined_Time_Out').onChange = DateCheck; </script> </div> Any suggestions would be greatly appreciated. Thanks in Advance. ! -
Accountability reacted to a post in a topic: Concatenating Virtual Fields Cascading Drop Downs
-
Please see the attached Screen Shot. This is the same working code in: https://forums.caspio.com/topic/7022-time-sheet-date-and-time-in-and-out/ Only changes made were, Dropdowns were changed to Cascading Dropdowns. The following is not working. Anything obvious ? Please advise... Thanks for helping <div id="con1"> <script> function concatenate1() { var One = document.getElementById("cbParamVirtual1").value; var Two = document.getElementByName("cbParamVirtual2")[0].value; var Three = document.getElementByName("cbParamVirtual3")[0].value; var Four = document.getElementById("cbParamVirtual4").value; var Five = document.getElementByName("cbParamVirtual5")[0].value; var link = One + " " + Two +":" + Three + ":"+Four + " "+Five; document.getElementById("InsertRecordDefined_Time_In").value = link; } document.getElementByName("cbParamVirtual5")[0].onchange = concatenate1; document.getElementById("cbParamVirtual1").onchange = concatenate1; document.getElementByName("cbParamVirtual2")[0].onchange = concatenate1; document.getElementById("cbParamVirtual3").onchange = concatenate1; document.getElementByName("cbParamVirtual4")[0].onchange = concatenate1; </script> </div> <div id="con2"> <script> function concatenate2() { var Six = document.getElementById("cbParamVirtual6").value; var Seven = document.getElementByByName("cbParamVirtual7")[0].value; var Eight = document.getElementByByName("cbParamVirtual8")[0].value; var Nine = document.getElementById("cbParamVirtual9").value; var Ten = document.getElementByByName("cbParamVirtual10")[0].value; var linkout = Six + " " + Seven +":" + Eight + ":"+Nine + " "+Ten; document.getElementById("InsertRecordDefined_Time_Out").value = linkout; } document.getElementByName("cbParamVirtual10")[0].onchange = concatenate2; document.getElementById("cbParamVirtual6").onchange = concatenate2; document.getElementByName("cbParamVirtual7")[0].onchange = concatenate2; document.getElementByName("cbParamVirtual8")[0].onchange = concatenate2; document.getElementById("cbParamVirtual9").onchange = concatenate2; </script> </div>
-
Validate Date and Time
Accountability replied to Accountability's topic in User JavaScript and CSS Discussions
Thank you so much for responding. Unfortunately it didn't work. I don't know if this makes a difference but there are two other working scripts right above it https://forums.caspio.com/topic/7022-time-sheet-date-and-time-in-and-out/ Any more advise would be greatly appreciated. -
Time Sheet Date and Time in and Out
Accountability replied to Accountability's topic in User JavaScript and CSS Discussions
Please See Above attachment. In attempting to integrate drop-down values so I could use both the working code (Above) and the drop-down. I unsuccessfully tried the following. If I can find a way for this code to work I will apply the same for every Work Schedule in the drop-down). Any advise would be appreciated. Code Snippet var shift = document.getElementById("Defined_Work_Schedule").value; var One = document.getElementById("cbParamVirtual1").value; var Two = document.getElementById("cbParamVirtual2").value; if (shift == "7:00 AM to 7:00 PM") var Two="07"; var Three = document.getElementById("cbParamVirtual3").value; if (shift == "7:00 AM to 7:00 PM") var Three="00"; etc.....- 6 replies
-
- timesheet
- date and time
-
(and 1 more)
Tagged with:
-
I am trying to make sure the time in entered is less than the time out entered. I was determined to figure this out on my own but just can get go any further without help. Here is my code. Since Defined_Date_Out is required, I thought replacing the users erroneous entry with null would prevent the submission from being initiated. Thanks for any advise ? <div id="datefix"> <script> function DateCheck() { var dateout = document.getElementById('Defined_Time_Out').value; var datein = document.getElementById('Defined_Time_In').value; if (dateout <= datein) alert("Please enter a date and time OUT after date and time IN "); document.getElementById("InsertRecordDefined_Time_Out").value = null; } document.getElementById('InsertRecordDefined_Time_Out').onChange = DateCheck; </script> </div>
-
Time Sheet Date and Time in and Out
Accountability replied to Accountability's topic in User JavaScript and CSS Discussions
For future reference here is the JS for both date and time In and date and time Out. I do have one question, is there a way to prevent the submission if someone chooses an OUT date and time which is less than the IN date and time. Just a little precaution. I was thinking if we could put an if statement which is in essence > Have Date Out required : IF Defined_Date_Out is Less than Defined_Date_In > reset Defined_Date_Out to Blank. Since it is required it would stop the submission. I am not sure of the syntax but I think the logic would work. As always thanks for any help. I have done a lot of testing and the following seems to work every time. <div id="con1"> <script> function concatenate1() { var One = document.getElementById("cbParamVirtual1").value; var Two = document.getElementById("cbParamVirtual2").value; var Three = document.getElementById("cbParamVirtual3").value; var Four = document.getElementById("cbParamVirtual4").value; var Five = document.getElementById("cbParamVirtual5").value; var link = One + " " + Two +":" + Three + ":"+Four + " "+Five; document.getElementById("InsertRecordDefined_Time_In").value = link; } document.getElementById("cbParamVirtual5").onchange = concatenate1; document.getElementById("cbParamVirtual1").onchange = concatenate1; document.getElementById("cbParamVirtual2").onchange = concatenate1; document.getElementById("cbParamVirtual3").onchange = concatenate1; document.getElementById("cbParamVirtual4").onchange = concatenate1; </script> </div> <div id="con2"> <script> function concatenate2() { var Six = document.getElementById("cbParamVirtual6").value; var Seven = document.getElementById("cbParamVirtual7").value; var Eight = document.getElementById("cbParamVirtual8").value; var Nine = document.getElementById("cbParamVirtual9").value; var Ten = document.getElementById("cbParamVirtual10").value; var linkout = Six + " " + Seven +":" + Eight + ":"+Nine + " "+Ten; document.getElementById("InsertRecordDefined_Time_Out").value = linkout; } document.getElementById("cbParamVirtual10").onchange = concatenate2; document.getElementById("cbParamVirtual6").onchange = concatenate2; document.getElementById("cbParamVirtual7").onchange = concatenate2; document.getElementById("cbParamVirtual8").onchange = concatenate2; document.getElementById("cbParamVirtual9").onchange = concatenate2; </script> </div>- 6 replies
-
- timesheet
- date and time
-
(and 1 more)
Tagged with: