Jump to content

ababcock

Caspio Ninja
  • Content Count

    52
  • Joined

  • Last visited

Everything posted by ababcock

  1. I have a details page where users edit their time sheets entries. It shows the original times entered and has fields for new times. It was working fine, but now it is not updating. They click the update button, but it doesn't record any of their new data. I looked at the page with the Developer View on Chrome, and it shows this error: "Uncaught TypeError: Cannot set property 'onmouseover' of null" I will paste the footer script below. Please help me figure out what's wrong with it! <script> document.getElementById('Mod0EditRecord').onmouseover = function(){ var date = document.getElementById('EditRecordDate').value; if(date == "") date = "1/1/2011"; var hour = document.getElementById('cbParamVirtual1').value; if(hour =="") hour="00"; var minute = document.getElementById('cbParamVirtual2').value; if(minute == "") minute = "00"; var ampm = document.getElementById('cbParamVirtual3').value; document.getElementById('EditRecordStart_Time').value = date + " " + hour + ":" + minute + " " + ampm; var hour2 = document.getElementById('cbParamVirtual4').value; if(hour2 =="") hour2="00"; var minute2 = document.getElementById('cbParamVirtual5').value; if(minute2 == "") minute2 = "00"; var ampm2 = document.getElementById('cbParamVirtual6').value; document.getElementById('EditRecordEnd_Time').value = date + " " + hour2 + ":" + minute2 + " " + ampm2; var start= new Date(document.getElementById('EditRecordStart_Time').value); var end = new Date(document.getElementById('EditRecordEnd_Time').value); var timeDiff = end - start; var hh = Math.floor(timeDiff / 1000 / 60 / 60); timeDiff -= hh * 1000 * 60 * 60; var mm = Math.floor(timeDiff / 1000 / 60); var totalmin= (mm+ (hh * 60)) ; document.getElementById('EditRecordHours').value = (totalmin/60).toFixed(2); }; </script>
  2. I have users that enter non-time entries in time fields, and I can't figure out how to block that. The most common errors are using the wrong punctuation (semi-colon or period instead of colon) and putting letters in (o instead of 0). I also have trouble with users entering the wrong AM/PM designation, resulting in totals of negative hours or hours over 12. Does anyone have suggestions? I have used text fields for time as well as the Caspio solution where you use multiple virtual fields to break down the parts of the time. The text field is easier, but I can do it either way. I have tapped out Caspio chat on this one, so I'm hoping someone here can help!
  3. I have a time sheet submission page where users enter their start and end times, and the system calculates their total hours. I'm trying to find a way to block them from entering spans of time greater than 12 hours (or hours less than 0) because this is usually an error in AM/PM selection. I'm hoping to have a pop-up that tells them there is an error they need to fix before they can submit it. Is there a way to do this? Below is what I have in my footer to calculate the time: <script> document.getElementById('Submit').onmouseover = function(){ var date = document.getElementById('InsertRecordDate').value; if(date == "") date = "1/1/2011"; var hour = document.getElementById('cbParamVirtual1').value; if(hour =="") hour="00"; var minute = document.getElementById('cbParamVirtual2').value; if(minute == "") minute = "00"; var ampm = document.getElementById('cbParamVirtual3').value; document.getElementById('InsertRecordStart_Time').value = date + " " + hour + ":" + minute + " " + ampm; var hour2 = document.getElementById('cbParamVirtual4').value; if(hour2 =="") hour2="00"; var minute2 = document.getElementById('cbParamVirtual5').value; if(minute2 == "") minute2 = "00"; var ampm2 = document.getElementById('cbParamVirtual6').value; document.getElementById('InsertRecordEnd_Time').value = date + " " + hour2 + ":" + minute2 + " " + ampm2; var start= new Date(document.getElementById('InsertRecordStart_Time').value); var end = new Date(document.getElementById('InsertRecordEnd_Time').value); var timeDiff = end - start; var hh = Math.floor(timeDiff / 1000 / 60 / 60); timeDiff -= hh * 1000 * 60 * 60; var mm = Math.floor(timeDiff / 1000 / 60); var totalmin= (mm+ (hh * 60)) ; document.getElementById('InsertRecordHours').value = (totalmin/60).toFixed(2); }; </script>
  4. I would also like to block negative amounts of time, for the reverse of this issue.
  5. I have a time sheet submission page where users enter their start and end times, and the system calculates their total hours. I'm trying to find a way to block them from entering spans of time greater than 12 hours because this is usually an error in AM/PM selection. I'm hoping to have a pop-up that tells them there is an error they need to fix before they can submit it. Is there a way to do this? Below is what I have in my footer to calculate the time: <script> document.getElementById('Submit').onmouseover = function(){ var date = document.getElementById('InsertRecordDate').value; if(date == "") date = "1/1/2011"; var hour = document.getElementById('cbParamVirtual1').value; if(hour =="") hour="00"; var minute = document.getElementById('cbParamVirtual2').value; if(minute == "") minute = "00"; var ampm = document.getElementById('cbParamVirtual3').value; document.getElementById('InsertRecordStart_Time').value = date + " " + hour + ":" + minute + " " + ampm; var hour2 = document.getElementById('cbParamVirtual4').value; if(hour2 =="") hour2="00"; var minute2 = document.getElementById('cbParamVirtual5').value; if(minute2 == "") minute2 = "00"; var ampm2 = document.getElementById('cbParamVirtual6').value; document.getElementById('InsertRecordEnd_Time').value = date + " " + hour2 + ":" + minute2 + " " + ampm2; var start= new Date(document.getElementById('InsertRecordStart_Time').value); var end = new Date(document.getElementById('InsertRecordEnd_Time').value); var timeDiff = end - start; var hh = Math.floor(timeDiff / 1000 / 60 / 60); timeDiff -= hh * 1000 * 60 * 60; var mm = Math.floor(timeDiff / 1000 / 60); var totalmin= (mm+ (hh * 60)) ; document.getElementById('InsertRecordHours').value = (totalmin/60).toFixed(2); }; </script>
  6. Sorry, I re-posted the first response initially as my response. Your solution worked, problem solved, thank you! Amanda
  7. That worked; thanks so much for your help! Amanda
  8. Thank you! This worked on the first field, but when I added an HTML block to count the words in a second field (and updated the field name), it's not working for the second field. The first one still works. Is there a trick to getting it to work twice? Thanks again! Amanda
  9. I'm looking for a way to show the WORD COUNT, rather than character count, in a text area. I found a script to do it, but it was not Caspio-specific and involved creating another text area. I'm hoping to find a way to do this within Caspio. Any ideas?
  10. I am trying to figure out a way to freeze the actual header on a results page. I know how to freeze the header row (the titles of each column), but I'm talking about the HTML Header above all of that. I have inserted info into this that I would like to scroll with the user as they go down the page. Is this possible?
  11. I am also trying to pass a Virtual Field to a saved field. I need to save Virtual3 (which is a cascading field) to a text area field, which is PCP_Diagnosis. It is on a submission form, and I'm having trouble figuring it out. I tried pulling from another submission page I had help creating, but it's not working. Here is what I have: <script> function changeVal() { setTimeout(function(){ { document.getElementById('InsertRecordPCP_Diagnosis').value = document.getElementsByName('cbParamVirtual3')[0].textContent;} else { document.getElementById('InsertRecordPCP_Diagnosis').value ="";} }; </script> I would use the script you posted, but I'm not sure what to replace the k_suppliermark part with. Any help is very much appreciated!!
  12. I am trying to create a log book that calculates hours. I have a submission form now that uses javascript to calculate hours based on a start time and end time, but I don't know how to expand that to multiple times. How can I re-write the javascript to apply to multiple start/end times? And can I make it ignore blank fields? Thanks for your help!
  13. I am trying to create a dashboard. I have several datapages, mostly search and reports where the search criteria is predetermined, that I would like to display on one page. I'm hoping to do this in a table, so that users can scroll down within each page, rather than having each one take up a lot of space. I know how to create a table on my end, and I can paste the embed code within it, but when I do, it makes the table adjust to the size of the datapage, resulting in a much wider table than I would like. I think the Styles settings on Caspio don't apply when you use the embed code, so I have tried adjusting my CSS stylesheet, but I'm still not able to affect how wide it is. I have been able to move the whole thing to the right using left-margin, and I can change the background color, but the overall width remains the same. Also, I would like to be able to adjust the height of each row in the table so that users have to scroll within the "cell" rather than having a web page that is really long. I can adjust this a little by editing the datapage to only show 5 or 6 results at a time, but adjusting the height would be much simpler for me. Does anyone have suggestions? Thank you!
  14. I am trying to create a button that connects users to a details page depending on their access level. Here is what I have in the button right now (URL changed): <input onclick="window.open('https://sample.org/edit.html?ID=[@field:Contact_Sheet_Number]')" type="button" value="Edit Content" /> I would like to adjust that so it directs - user level users to one page: https://sample.org/edit.html - management level users to one page: https://sample.org/edit1.html - admin level users to one page: https://sample.org/edit2.html I was directed to this page for help: http://howto.caspio.com/tech-tips-and-articles/common-customizations/create-user-specific-redirect-after-login/ which explains redirect after login based on access level, but I was wondering if I could just insert the HTML code into the HTML box my button is in (rather than a standalone login screen). Here is the code they recommend: <script> if("[@authfield:Admin]" == "Yes"){ window.location = "http://www.mysite.com/admin.html"; } else if ("[@authfield:Manager]" == "Yes"){ window.location = "http://www.mysite.com/manager.html"; } else{ window.location = "http://www.mysite.com/employee.html"; } </script>
  15. Like this? Also not a JS expert -- just piecing it together as I go! <script>document.getElementById.value("cbParamVirtual1")</script>
  16. I have an HTML block in a submission form, and I'm trying to bring up some info based on the client selected. I created 10 virtual fields that use cascading dropdowns to retrieve this info. The virtual fields are hidden, and I am trying to show their results in an HTML block. Here is what I have come up with, but it's not showing the results on the deployed page. I checked the virtual fields, and they are bringing up the right information, so I must not be referencing it right in the HTML block. Does anyone know how to fix it? Thanks!! <div style="background:#e9e9e9;width: 300px"> <b>Potential contacts:</b><br /> <b>Case Manager:</b> <script>document.getElementById("cbParamVirtual1")</script> <b>Emergency Contact:</b> <script>document.getElementById("cbParamVirtual2")</script> <b>Physician:</b> <script>document.getElementById("cbParamVirtual3&";)</script> <b>Psychiatrist:</b> <script>document.getElementById("cbParamVirtual4")</script> <b>Therapist:</b> <script>document.getElementById("cbParamVirtual5")</script> <b>Advocate:</b> <script>document.getElementById("cbParamVirtual6")</script> <b>Pharmacy:</b> <script>document.getElementById("cbParamVirtual7")</script> <b>Employer:</b> <script>document.getElementById("cbParamVirtual8")</script> <b>Payee:</b> <script>document.getElementById("cbParamVirtual9")</script> <b>Guardian:</b> <script>document.getElementById("cbParamVirtual10")</script></div>
  17. I am trying to freeze a header on a Details page -- is there a way to adapt this to a Details page (rather than the results page)?
  18. Sorry, I should have mentioned that this is on a submission form, not a report. Any suggestions?
  19. Can you make a listbox appear in more than one column? Mine has around 25 options, so it would look better if I could spread it out rather than having one long list.
  20. Here is what I have come up with so far. I inserted this in an HTML box placed before the fields that go in the table: <table border="1" style="width:100%"> <tbody> <tr> <th>GOAL/DESIRED OUTCOME</TH> <TH>Increments ACTION STEPS with dates</th> <th>INDIVIDUALS/ORGANIZATIONS TO ASSIST WITH CARRYING OUT THE INTERVENTIONS AND SUPPORTS</TH> </tr> <tr> <td> Then I added HTML boxes in between each field. In those, I put </td><td>. At the end of each row, I put </td></tr><tr><td> in the HTML box. At the end of the table, I put: </td> </tr> </tbody> </table> in another HTML box. I attached a screen shot of what that looks like. I can't get the fields to display in the same row. I tried checking "continue next element on the same line," but that didn't fix it either. Any suggestions?
  21. I am in the process of creating a new Submission Form, and I want some of the fields to display in a table format. I have used HTML to create tables before, but they included links, not fields. It's probably pretty simple, but it's really hard to search for this solution! Does anyone know how to accomplish this?
  22. ababcock

    Edit Details Page

    I forgot to mention that users reach my standalone details page through a button. Opening in a new tab is a great solution -- here's what I found: <input type="button" value="Open Window" onclick="window.open('http://www.domain.com')"> I adjusted it to for my needs, and it works perfectly. Thanks!
  23. It currently includes 150 records with 175 fields (1.05 MB). Since I need to pull up text with more than 255 characters, I had to use javascript to create a cascading text area. Here is the javascript (the lower part refers to calculating the total hours based on a start time and end time entered): <script> function changeVal() { setTimeout(function(){ if (document.getElementsByName('cbParamVirtual1')[0].textContent != "First make your selection above") { document.getElementById('InsertRecordClient_Goals').value = document.getElementsByName('cbParamVirtual1')[0].textContent;} else { document.getElementById('InsertRecordClient_Goals').value ="";} if (document.getElementsByName('cbParamVirtual5')[0].textContent != "First make your selection above") { document.getElementById('InsertRecordOngoing_Supports').value = document.getElementsByName('cbParamVirtual5')[0].textContent;} else { document.getElementById('InsertRecordOngoing_Supports').value ="";} }, 1000); } document.getElementsByName('InsertRecordClient_Name')[0].onchange= changeVal; document.getElementById('Submit').onmouseover = function(){ var date = document.getElementById('InsertRecordDate_of_Service').value; if(date == "") date = "1/1/2011"; var hour = document.getElementById('cbParamVirtual2').value; if(hour =="") hour="00"; var minute = document.getElementById('cbParamVirtual3').value; if(minute == "") minute = "00"; var ampm = document.getElementById('cbParamVirtual4').value; document.getElementById('InsertRecordStart_Time').value = date + " " + hour + ":" + minute + " " + ampm; var hour2 = document.getElementById('cbParamVirtual6').value; if(hour2 =="") hour2="00"; var minute2 = document.getElementById('cbParamVirtual8').value; if(minute2 == "") minute2 = "00"; var ampm2 = document.getElementById('cbParamVirtual7').value; document.getElementById('InsertRecordEnd_Time').value = date + " " + hour2 + ":" + minute2 + " " + ampm2; var start= new Date(document.getElementById('InsertRecordStart_Time').value); var end = new Date(document.getElementById('InsertRecordEnd_Time').value); var timeDiff = end - start; var hh = Math.floor(timeDiff / 1000 / 60 / 60); timeDiff -= hh * 1000 * 60 * 60; var mm = Math.floor(timeDiff / 1000 / 60); var totalmin= (mm+ (hh * 60)) ; document.getElementById('InsertRecordTotal_Units').value = (totalmin/60).toFixed(2); }; </script>
  24. I have text areas in a submission form that load based on the selection a user makes. I am running into a problem where this is sometimes taking way too long, and while it works on it, the fields fill in with "Loading..." If a user submits the form before the fields load, the field remains filled in with "Loading..." rather than the data that should be there. Is there any way to speed that up? Is it just because the table is getting full of data, so the lookup is taking too long? Has anyone run into a similar issue? Thanks for you help!
×
×
  • Create New...