Jump to content

TsiBiRu

Caspio Guru
  • Posts

    116
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by TsiBiRu

  1. HI @kpcollier, You're welcome, I'm happy to now that this is working for you now. It was my pleasure to assist you with this. Kind regards, TsiBiRu
  2. Hi @kpcollier, To test if the code is working, I would suggest to look in the URL and see if the parameter contains a value. If it has a value, then it only confirms that there is nothing wrong with your code. We just need to fix this on the receiving part and ensure that we are receiving it using the exact variable name [@val] in this example In regards to your second question, you will simple need to add a new HTML block to and create a new/2nd drop-down <!-- As you can see, I've added '2' in my id below id='2[@field:Listing_ID], this is to diffrentiate it with our first dropdown so that we can target it correct using its repective id. To make it simple, 2 is just a prefix to indicate that it is the second dropdown of the row ex: id of row is 2 first drop-down ID:2 second drop-down ID:22 and ... --> <select id='2[@field:Listing_ID]'> <option value="[@field:Address]">[@field:Address]</option> <option value="[@field:Address_Line_2]">[@field:Address_Line_2]</option> </select> Then we will just need to add some code in our JS to capture the selected value of our second value, and to add it to our query string <button type="button" onclick="myFunction([@field:Listing_ID])">Click me</button> <script> function myFunction(x) { // Getting the value of the first drop-down var e = document.getElementById(x); var strUser = e.options[e.selectedIndex].value; // Getting the value of the second drop-down var f = document.getElementById('2'+x); var endUser = f.options[f.selectedIndex].value; window.location.replace("https://www.google.com?val=" + strUser + "&val2="+endUser ); } </script> I've also added in this response a copy of the DataPage that I've updated, it now contains two drop-down per row/record. And the selected value of this drop-downs is being passed to my test site (google.com). You can download it to your account so that you can review the code, and see how it works if you will be encountering some issue implementing this solution, you can just provide me with an exported copy of your Datapages (Sending & Receiving) so that I can help you to implement this. Kind regards, TsiBiRu CaspioData_2019-Apr-04_2309.zip
  3. Hi @kpcollier You are already right, you will just need to update the variable on your on load to match the one that we've passed in our code So that would be [@strUser] in my example. window.location.replace("https://www.google.com?val=" + strUser); Regards, TsiBiRu
  4. Hi @kpcollier No worries, it is always my pleasure to help anyone in this community. You can try to use the code below, I've added two HTML blocks on my Tabular Report Datapage. 1st HTML Block is to display the drop-down <!-- I've set the ID to the ID of the records so that we will pass the selected value from the drop down where the button is clicked--> <select id='[@field:kpcollier_Client_ID]'> <option value="[@field:Primary_Client]">[@field:Primary_Client]</option> <option value="[@field:Additional_Client]">[@field:Additional_Client]</option> </select> 2nd HTML block is to create a custom button to get the selected value of the selected value from the drop-down of each respective row //I've passed the ID of the row as a parameter to our function <button type="button" onclick="myFunction([@field:kpcollier_Client_ID])">Click me</button> <script> // Received the ID, and store it on the variable x function myFunction(x) { //This code will get the selected vale from drop-down and store it to strUser variable var e = document.getElementById(x); var strUser = e.options[e.selectedIndex].value; // This code will redirect it to your prefered site via query string window.location.replace("https://www.google.com?val=" + strUser); } </script> I've also added the exported copy of the DataPage that I've worked with so that you can import it to your account and see how it works I hope this helps. Regards, TsiBiRu CaspioData_2019-Apr-04_2034.zip
  5. Hi @kpcollier I've created a solution for this and provided it to your post below Regards, TsiBiRu
  6. Hi @kpcollier If what you want is to create a dropdown which contains values from your two fields, the I can suggest that you create your own custom drop-down, and use the value of your fields for both the display and stored value. <select id='dropID'> <option value="[@field:FieldName]">[@field:FieldName]</option> <option value="[@field:FieldName]">[@field:FieldName]</option> </select> I hope this helps, Regards, TsiBiRu
  7. Hi @bbeshlian, The code below does not hide the submit button, but it will prevent the user from submitting the form until the entered value is valid. For this solution to work, the value of the Virtual 2 (Which is a calculated field ) should be positive So basically, the code below will get the value of 'Virtual2' field and if the value is negative it will prevent the form from being submitted until the value of this field is a positive number. <script> document.querySelector('#caspioform').onsubmit = function(e) { e.preventDefault(); var balance= document.getElementsByName('cbParamVirtual2')[0].value; if(balance<0) { alert('Not enough Balance!'); } else { this.submit(); } } </script> I think you can use the code as it is, you will just need to update the name of the field that we are basing or validation (This line ' var balance= document.getElementsByName('NameOfyourField')[0] .value ; ' ) To get the name of your field, you can follow the steps that I've provided here, but instead of getting the ID, you will be getting the name of the field on Step 3 I've attached the exported copy of the Datapage that I've worked with so that you can import it to your account and see how it works (Kindly see the attached file). If you are still having an issue in making this work, kindly provide us the deployed URL of your Datapage and we will make the necessary adjustment to make this solution work. Kind regards, TsiBiRu CaspioData_2019-Apr-03_1826.zip
  8. Hi @DaveC2019, So that we can assist you better with this, kindly provide as an exported copy of your DataPage so that we can formulate the validation directly to it. Please export it with its dependencies If your ables contains sensitive information then you can just export your table without Data, to reach the interface below you will need to click the 'Add' button first. Kind regards, TsiBiRu
  9. Hi @bbeshlian, Can you point me to the forum post where I've provided this code, please? And you can also provide us the direct URL of the DataPage that you are currently working so that we can make the necessary adjustment to make the code work. I'm guessing that we just need to update the this line 'var amount = document.getElementsByName('Virtual2')[Invalid].value;' Regards, TsiBiRu
  10. Hi @PackDaddy, I've created a sample Datapage with your workflow so that you can download and import it to your account so that you can see how it works. Please see the attached file Earth Moon MARS What I did are the following: 1. I've created virtual fields to allow the user to enter the weight of each the objects, and allow them to select the Space Object (Earth, Moon, Mars) 2. Then I've created an HTML block to display the message 3. After that, I've added the fields from my table that will get its value from the user input. Here is the sample Case WHEN statement CASE WHEN '[@cbParamVirtual1]' = 'Earth' THEN [@cbParamVirtual2] WHEN '[@cbParamVirtual1]' = 'Moon' THEN [@cbParamVirtual2] * 0.165 WHEN '[@cbParamVirtual1]' = 'Mars' THEN [@cbParamVirtual2] * 0.38 END I hope this helps. Regards, TsiBiRu CaspioData_2019-Apr-02_2241.zip
  11. Hi @bbeshlian, I'm happy to know that I was able to help you with this one. Regards, TsiBiRu
  12. Hi @bbeshlian, I was able to create validation without using JavaScript, what I did is the following: 1. I've created a virtual field and use the SQL statement below to compare the dates ( installment payment date (Date1) and effective date (Date2) ) to determine if it is valid or not. 2. I've hidden that virtual field using the method in this article CASE WHEN [@field:Date1] < [@field:Date2]THEN 'Invalid' ELSE 'Valid' END 3. Then I've inserted an HTML block to display the error Message, and added it to section two. 4. Then I've created a rule that will only display the Error message if the value in our virtual field is invalid 5. Then I was able to prevent the user in submitting the form using the solution on this forum post I've also added the exported copy of the DataPage that I've worked with so that you can import it to your account and see how it works I hope this help. Regards, TsiBiRu CaspioData_2019-Mar-30_0553.zip
  13. Hi @bbeshlian, That is good to know. Regards, TsiBiRu
  14. FHi @bbeshlian, If you want to set a default value to your number/currency field you can achieve this using two options. 1. Is setting/assigning the default value in your Datapage(Usually Submission Form), go to the Advanced Tab of your field then click on 'On load' and try to make it like the one below. 2. The other option is via Trigger action. For more details about this kindly check this Article I hope this helps. Regards, TsiBiRu
  15. Hi @DaveC2019, Just follow the steps that I've provided in my previous comment, especially adding a virtual field where we will use an SQL statement to check if the inputted receiver name is in your table. And just update the 'cbParamVirtual1' in the code below accordingly <script type="text/javascript"> // This function will run if the value in our Virtual1 is change document.getElementsByName('cbParamVirtual1')[0].onchange = function() {myFunction()}; function myFunction() { // This code will get the value of Virtual1 var test = document.getElementsByName('cbParamVirtual1')[0].value; // This code will check Virtual1 is empty, and hide the submit button if it is if (test.length == 0){ document.getElementById("Submit1").style.display = "none"; } else{document.getElementById("Submit1").style.display = "block";} } </script> I've updated the code above, it will be hiding the 'Leave a Tip' button in your submission form. If you will still be having issue implementing my solution, just provide me with an exported copy of your DataPage with its dependencies. And if your table contains sensitive data, just click on 'Tables' then click on your table and select'Without Data' Kind regards, TsiBiRu
  16. Hi @kkounkel, When you say you wanted to send a random policy manual to your employees, what are the expected behavior of your workflow? 1. Does all of your employees will receive the same random policy manual per week or each employee can have a different manual that is sent to him/her per week? 2. Do you want to restrict duplicate policy manual being sent to your employee (An employee can't receive the same manual again unless all the other manual is received)? - If yes, what will happen when all the manual has been sent(Do you intend to start a new round, like starting the random sending of manual again)? I think it would be easier if you will not make the sending of policy manual random, instead of making it sequential, then you can set schedule a team meeting to review the Policy manual of the week. This will ensure that all of your employees are all calibrated at the same time, and you can address all of their inquiries for the same manual at the same time. Whether you agree to my suggestion or not, I think this is doable by creating a task that is set to run every week to send a policy manual to your employees. But the process will depend on your workflow. For more details about tasks, you can review this article I hope this helps. Kind regards, TsiBiRu
  17. Hi @joneslovescaspio, Kindly elaborate on your workflow, so that we can better help you with this. Regards, TsiBiRu
  18. Hi DaveC2019, What you need to do is to add a virtual field in your submission form, then set its form element as a calculated field and use the SQL code below to check if the receiver name that the user entered can be found in your user authentication table. I've also added the exported copy of the sample DataPage that I've worked with, just import it to your account so that you can see how it works. Kind regards, TsiBiRu You can try using the SQL below, the code below will get the a value from your 'combined_user_name' field in your 'UserAuthentication' table if there is a matching record. If it will not work, just ensure that field name and table name is correct. SELECT combined_user_name FROM UserAuthentication WHERE combined_user_name = target.[@field:InsertRecordreceivername] After that, I've hidden the virtual field using the method in this article Then add the JS code below on the footer of your Datapage, just replace the number of the 'cbParamVirtual1' in the code below to match the number of your virtual field. Let's say that the virtual field that you have added to use the SQL code above is 'Virtual5', then just update 'cbParamVirtual1' to 'cbParamVirtual5' <script type="text/javascript"> // This function will run if the value in our Virtual1 is change document.getElementsByName('cbParamVirtual1')[0].onchange = function() {myFunction()}; function myFunction() { // This code will get the value of Virtual1 var test = document.getElementsByName('cbParamVirtual1')[0].value; // This code will check Virtual1 is empty, and hide the submit button if it is if (test.length == 0){ document.getElementById("Submit").style.display = "none"; } else{document.getElementById("Submit").style.display = "block";} } </script> CaspioData_2019-Mar-27_1853.zip
  19. Hi @twinsdad, Just to add up to the previous comment, to turn off the default results if nothing is entered into the search you can set your report DataPage to 'Display search form and results on separate screens' By setting it up this way, it will not display any results until the user searched for something. For more details about this, you can check this article I hope this helps. Regards, TsiBiRu
  20. Hi @DesiLogi, I think your code above is not set to go to 'Next Record' in your details page, it will simply submit/update the record that is currently on the first record that is being displayed on your Details Page. It is just like clicking directly on the Update button, and after that, you will be redirected to the Results Page. Because if you analyze your code, let's say that the value of your virtual field now is 10, so it will go to your else condition (which is basically the code below) which will submit/update the record. After that, it will be redirected to the results page of your Report DataPage without going to the 'Next Record ' in your Details Page <script type="text/javascript"> if(document.getElementById("caspioform")) { setTimeout('document.forms["caspioform"].submit()',1000); } </script> Kindly elaborate on your workflow, so that we can provide you better solution/suggestions. What are you trying to achieve with this workflow? and how do you pass and received the values that you are updating in your Details Page? Kind regards, TsiBiRu
  21. Hi @joneslovescaspio, Just to add up to the previous comment, I think it would also be better if you check this article it contains useful information about some issue that you may encounter with your JavaScript codes when the Ajax loading is enabled. And it contains information on how to fix it. I hope this helps Regards, TsiBiRu
  22. Hi @ hctr1 I've just tested the code below directly on your web site using the Dev Tools, and I can confirm that the code below is now working. You just need to copy and paste this code on the footer of your DataPage and that should do it. <script type="text/javascript"> document.getElementsByName('cbParamVirtual1')[0].onchange = function() {myFunction()}; function myFunction() { // submit the form if an value is selected setTimeout('document.forms["caspioform"].submit()',1000); } </script> Let me know if you will still encounter some issue. Regards, TsiBiRu
  23. Hi @hctr1 Thank you for providing the deployed URL of your DataPage and a login credential. I had a hard time making this solution work on your webpage as well. When I access your DataPage directly using your deployed URL (https://c5esh804.caspio.com/dp/b1c76000b16b1c0bcbb643b38c67) this code works, which will submit your submission DataPage. Kindly try this on your end as well <script type="text/javascript"> document.getElementsByName('cbParamVirtual1')[0].onchange = function() {myFunction()}; function myFunction() { // submit the form if an value is selected setTimeout('document.forms["caspioform"].submit()',1000); } </script> However, if we are accessing your DataPage on your web page (https://pablo.agronosotros.com/dashboard/) the code above will no longer work. That is because the form 'id' and the form 'action' will be gone when your DataPage is deployed on your web page. In the direct URL, the form ID of your DataPage is set to 'caspioform' However, on your web page, the form 'ID' and the 'action' of your DataPage will be will be gone that is why the code will no longer be working. I think this has something to do with your CMS/site builder. Which is beyond Caspio, may I know what CMS are you using? Is it possible for you to manually change the form element/properties in your CMS? Regards, TsiBiRu
  24. Hi @hctr1, You are using a Submission Form/DataPage, right? You can just try to disable the Ajax loading in your DataPage, just click on this button. If you are still having an issue making the solution above work, please provide me the deployed URL of your DataPage, and I will try to fix this for you. Regards, TsiBIRu
  25. Hi @hctr1 To find the ID of your dropdown just follow the steps below. 1. On the preview or deploy mode of your Datapage press F12 on your keyboard to open the Dev Tools in your browser 2. Then press Ctrl+Shift+C on your keyboard, or simply click on this Icon, just make sure that it is highlighted. 3. Click on your Dropdown, the element attribute of your dropdown should be highlighted Just double click on the 'id' (cbParamVirtual1 in this example), then copy and paste it to our code in my previous comment. I hope this help. Regards, TsiBiRu
×
×
  • Create New...