Jump to content

EmmePGN

Members
  • Posts

    24
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by EmmePGN

  1. Hello, I've been looking at the CASPIO guide for Ajax loading. There are few refs in there that are helpful, but my knowledge of javascript is limited. But I have this use case, and I was wondering if there is a way to conditionally submit an update form ONLY if the other Datapage (deployed on the same webpage) is "SAVED" or UPDATED. Here's the use case: 1. User must fill out the form on the left FIRST and then click "Save". 2. Then user can fill out the right Form and click "Next" only if they completed the form on the left. If the form on the left is not Updated or Saved, users should be prevented from submitting the form and an error message pops up to tell users that have to Save the form on the left. The attached picture is a webpage with 3 caspio datapages, I attached it for reference. I will truly appreciate any help in building the script that perhaps with below functionality. I hope I am making some sense. <script type="text/javascript"> document.addEventListener('BeforeFormSubmit', function(event) { }); document.addEventListener('BeforeFormSubmit', function (event) { if (event.detail.appKey == 'MY_DATAPAGE_APPKEY') { //check if .appKey == 'MY_DATAPAGE_APPKEY' is updated and give a pop up message. } else if (event.detail.appKey == 'MY_WEB_FORM_APPKEY') { //submit the form } }); </script>
  2. SOLVED! Thank you all for assistance. I finally figured out my issues and what I now have, works. The first thing I did was to calm my brains AND look at things from a 10K view. I finally quit trying to combine two events in one trigger. I was forcing the Insert and Update events together in one trigger, which is not a best practice. This can kill brain cells really quick. So, I separated these two events into 2 triggers. They now work perfectly well. Yeayyyy me! My first objective was to "INSERT" the new records to multiple tables after said new records are entered into the parent table (yes, they are relationally linked). That first image has multiple tables getting their records from the parent table. This block arrangements for the Insert trigger works really well. My second objective was to "UPDATE" the records from the multiple tables after they are updated from the parent table. The block arrangements for update also works really well for me. I thought I'd share my experience and I hope this helps others. Lesson learned = "NEVER OVERTHINK" BE SIMPLE. Simple helped me. I must add that the EEID, which is the trigger point is an auto number. I defined a scenario that as long as EEID is greater than 0, things will be copacetic. Naturally though, EEID will be greater than zero when a new record is created. Hope I make sense.
  3. I have 2 tables joined in Views. I tried both inner and outer join for a field EEID which is an auto number in the parent table and an integer in the child. But when I enter a new record in the parent table, the record doesn't get inserted into the child table. I also tried relating the two tables via relationship setup. I tried both "inner" and "left outer" connections and "one-to-many" for the parent table. None of these work. Lastly, I already have a trigger setup in the parent table and from what I understand, you can only use a trigger to update one other table. Is my understanding wrong about triggers? Can anyone please help with the relational setup? How can I arrange it so that whenever I enter a new record in the parent table, the child table(s) will have the same record (e.g. EEID) ? Emme
  4. Hello LittleMsGinger. I am fully aware of the requirements by Caspio regarding the 3rd party cookie settings for all browsers. The issue still keeps on popping up on Safari. I read somewhere that if you used a styling setup native to Caspio this can be resolved. I tried that too. I made no changes to the resident style "Caspio" for my authentication and for the corresponding html pages. Still, the pop up happens causing my login form to warp.
  5. With the help of a Caspio Chat Support agent, Ian Natividad (very helpful person), I managed to create a triggered action that would update fields from one table after a certain value is entered from another table. I have over 200 records and now wish to update all in one go by uploading an excel workbook update. But the trigger I created (through the very helpful person), doesn't seem to work on bulk updates. It only works when I do a one record update at a time activity. Am I missing something? Or are triggers designed to only work on one single record update action at a time? Please help. Below is the said trigger. Thank you in advance.
  6. Hi Potato and Nice Duck, thank you for responding to me. I will follow the thread dated April 8 about similar issues. Thank you.
  7. Hello TellmeWhy, I tried to use this on an Update page. Replaced "insert" with "edit", not working on my end. Can you please show the right way to use the code on a single record update page? Thank you.
  8. Hi all, my calculated field that pulls data from a List String field is showing "Valid" prior to saving my datapage. However, when I look at the actual page on preview it is showing me an error message "Calculation Error". Anyone knows where I'm going wrong? Please help thank you. Below is my simple code (per Caspio instructions). The [@KnwIT] is a list-string. CASE WHEN [@KnwIT] IS NULL THEN 'Not Done' WHEN [@KnwIT] IS NOT NULL THEN 'Complete' END
  9. Hi everyone, I have this calculated field for which I was trying to gather the results as selected by users from a Multi-Select form. The results are numerical values, but what I need to do is use the corresponding narrative (in text form) of these values, and have them concatenated. My very simple code is the one we all use for simple "SELECT" from specific table. Is there a way for me to get the narrative text results from the multi-select? My code is below: SELECT Roles_Basic FROM a_Lookup_Roles WHERE Score_3=target.[@field:Role_Basic] Please help. Thank you so much.
  10. Hi Meekee, Here is the link for log in. https://pgnjobfox.com/login/?cbr=3a7f700082dedfdbff6b47dd8d4a Thank you.
  11. LittleMsGinger, I have a similar, I tried your code, it didn't work. I also tried the technique of "not customizing texts". The 3rd party cookie pop up error still keeps on coming up and keeps on warping (deforming) my login form. Is there anything else we could do? I reached out to customer service, opened a ticket, they can't seem to solve the issue.
  12. Good morning all, I deployed my forms via Wordpress. My authentication login form keeps on getting "calywampus" whenever a first time user clicks the page to login, the field boxes turn very narrow. All the 3rd party cookies and javascript system requirements by Caspio has been allowed in all of my webpages, Safari, Chrome, Firefox, Vivaldi. I attached a snap shot of my login form for reference. Can anyone please help me, is there an SQL code or a script to prevent this from happening? I appreciate your help. Thank you so much.
  13. Hello, I'm trying to summarize the results of a form that has numbers for values. The numbers correspond to narrative texts in another field (in the same table). Is there a way to show or select the narrative texts on to my datapage in place of their corresponding number values? Thank you. I hope I explained this well.
  14. Hi SinJunYoung, Thank you so much for helping me. I have played with Caspio's resident functionality of "rules" many times over. The added issue is that I need the fields "FrequencyA", and "FrequencyB" hidden by default. Either one of them would show only when the user chooses either one. With your recommendation it would mean that FrequencyA and FrequencyB would be visible by default, which runs contrary from what I need. Thank you so much for helping.
  15. Hello Vitalikssssss Thank you so very much for the code. It is working. Thank you. There is a new issue though. The value results of the selection are now bunching together at the bottom of the list box. The results somehow begin to occupy the extra space that is generated by the multi-list box. I attached an image here to show what I'm saying. Any recommendation for this issue? I will appreciate your further help.
  16. Hello, Can anyone please help me on imposing a limit to the number of selections users can have from the multi-select listbox. The form is an Update Form. Below is my script, and it is not working. It is still allowing users to press on. Thank you so much in advance. <script type="text/javascript"> var v_state = "[@field:TypesWrittenComm]" ; var o_state = document.getElementById("EditRecordTypesWrittenComm") ; o_state.multiple = true ; function f_listbox() { if ( v_state.indexOf(",") > 0 ) { for (var i=0 ; i < o_state.options.length; i++ ) { if(o_state[i].value == v_state) { o_state.remove(i); break ; } } var o_st = v_state.split(", ") ; for (var j=0 ; j < o_st.length; j++) { for (var i=0 ; i < o_state.options.length; i++ ) { if(o_st[j]== o_state.options[i].value){ o_state.options[i].selected = true ; break ; } } } } } function check_listbox() { var maximum_selections = 3; var MyListbox = document.getElementsByName("EditRecordTypesWrittenComm")[0]; var number_selections = 0; for (var i=0; i<MyListbox.length; i++) { if (MyListbox.options[i].selected) number_selections++; } if (number_selections>maximum_selections) { alert("You can select only " + maximum_selections + " items"); return false } } document.addEventListener('DataPageReady', f_listbox); //You can also use the line below instead of the eventlistener // setTimeout(f_listbox, 20); </script>
  17. Hello @Hastur Thank you so much for the help. I am going to try to get the Element of the target input by Name instead of by ID. Because it's still not working for me. I'll try a different approach, if the getElementbyName('Certification')[0]; doesn't work. Many thanks. I'll keep you posted.
  18. I need to add that that the event.target.value is numeric, not text.
  19. Hi Andrew, Thank you so much for helping me. The code didn't work for my page. I am showing below what I have (including the parts that I changed). Can you please check where I'm going wrong? <script> function hideFieldsHandler(event) { let targetInput = document.getElementById("EditRecordCertification"); let firstField = document.getElementById("EditRecordFrequencyA").parentNode.parentNode; let secondField = document.getElementById("EditRecordFrequencyB").parentNode.parentNode; if (event.target.value = 300) { firstField.style.display = "none"; secondField.style.display = ""; } else if (event.target.value = 500) { secondField.style.display = "none"; firstField.style.display = ""; } } function changeHandler() { document.getElementById('EditRecordCertification').addEventListener('change', hideFieldsHandler); let firstField = document.getElementById("EditRecordFrequencyA").parentNode.parentNode; let secondField = document.getElementById("EditRecordFrequencyB").parentNode.parentNode; firstField.style.display = "none"; secondField.style.display = "none"; document.removeEventListener('DataPageReady', changeHandler); } document.addEventListener('DataPageReady', changeHandler); </script>
  20. Hello all, I am hoping someone can help me with a javascript and figure out how to hide/show fields based on user selection from a drop down field. I tried the rules section for this and it is not serving what I need. I also searched the forum to see if there is something I could use. But can't find any that I could understand. I have an UpdateForm. My field name for the drop down is 'Credentials' My other two fields are 'Frequency 1' and 'Frequency2' There are 2 choices in the drop down field: Certificate and Licensure If the user chooses 'Certificate' I would like the 'Frequency 2' to be hidden and 'Frequency 1' to be a required field. If the user chooses 'Licensure' the 'Frequency 1' should be hidden and 'Frequency 2' should be a required field. Please help. Thank you so much in advance.
  21. Hi vitalikssssss, thank you for this. I opted to use the SQL syntax that creates a deliberate error message, I think it's more attention-grabber than the disappearing button (so it's more like "the flogging will not stop until everyone gets it" kind of stuff). Incidentally, I edited the character and integer combination like so, which works for me and my Update Datapage. I know this is elementary, but still....Yeayyy me! The number of numeric variables after the character variable 'a' (to be cast) corresponds to the number of fields that I wanted to sum up. Which is 5. CASE WHEN (( (Isnull([@field:PointFactor_Duties_PercentDuty1],0)+Isnull([@field:PointFactor_Duties_PercentDuty2],0)+Isnull([@field:PointFactor_Duties_PercentDuty3],0)+Isnull([@field:PointFactor_Duties_PercentDuty4],0)+Isnull([@field:PointFactor_Duties_PercentDuty5],0) ) ) >100) THEN CAST( 'a' + 1 + 1 + 1 + 1 + 1 as INT) ELSE (Isnull([@field:PointFactor_Duties_PercentDuty1],0)+Isnull([@field:PointFactor_Duties_PercentDuty2],0)+Isnull([@field:PointFactor_Duties_PercentDuty3],0)+Isnull([@field:PointFactor_Duties_PercentDuty4],0)+Isnull([@field:PointFactor_Duties_PercentDuty5],0) ) END Ciao!
  22. Hello, I'm new to Caspio. I have an Update Form with a calculated field called "Total_Percentage", that takes the values from other fields. Code below: Isnull([@field:PointFactor_Duties_PercentDuty1],0)+Isnull([@field:PointFactor_Duties_PercentDuty2],0)+Isnull([@field:PointFactor_Duties_PercentDuty3],0)+Isnull([@field:PointFactor_Duties_PercentDuty4],0)+Isnull([@field:PointFactor_Duties_PercentDuty5],0)+Isnull([@field:PointFactor_Duties_PercentDuty6],0) What I would like to do is to prevent users from going forward when their total exceeds 100%. I also, would like to show them, which field(s) is/are causing this field to go over the threshold of 100%. The rules section is not conducive to this goal, as rules section is limited. Triggered action section forces me to either email or text the users if their total exceeds 100%. I don't want to do this, since the whole point is for users to correct errors immediately. Is there anyone out there who can impart me a script or two to help me? SQL or javascript that would work with Caspio. Thank you so much. Emme
×
×
  • Create New...