Jump to content

TsiBiRu

Caspio Guru
  • Content Count

    116
  • Joined

  • Last visited

  • Days Won

    6

TsiBiRu last won the day on September 19 2019

TsiBiRu had the most liked content!

1 Follower

About TsiBiRu

  • Rank
    Advanced Member

Recent Profile Visitors

514 profile views
  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
×
×
  • Create New...