Jump to content

Wikiwi

Caspio Guru
  • Posts

    116
  • Joined

  • Last visited

  • Days Won

    12

Reputation Activity

  1. Like
    Wikiwi got a reaction from vidierre in [FYI] Item picker for characters with diacritical marks   
    Just wanted to share this usecase to allow user to input characters with diacritical marks in them(è, î, ñ, â).
    This small modification will help users input characters with diacritical marks using a dropdown list and a button. For this scenario, I will use a submission form but this can be modified and can be used to Single Record Update and Details Page.
    First, you would need 2 new fields for each text field or text area you wish to implement.
    - 1 virtual field set to a dropdown list that will contain the characters.
    - 1 HTML block that will serve as a button and container of the javascript.
    Here is the script that needs to be inside the HTML BLOCK:
    <style> #letter{     background: #3B6AD2;     border: none;     color: #FFFFFF;     display: inline-block;     font-family: Arial, Helvetica, sans-serif;     font-size: 12px;     font-weight: 400;     text-align: center;     text-transform: uppercase; } </style> <button type="button" id="letter">pick</button> <script> document.getElementById('letter').addEventListener('click',AddLetter); function AddLetter(){ document.getElementById("<textfield_ID>").value = document.getElementById("textfield_ID").value + document.getElementById("<virtualfield_ID>").value; } </script> Sample Output:

  2. Like
    Wikiwi got a reaction from KG360 in Can I interrupt a submission when 2 fields have the same data?   
    I tried the script (my configuration and yours) on a Details Page and it should worked just fine. If you're having issues with it, maybe you should put the script in the footer and not the header. But I tried both configurations on my end and I haven't encountered any errors.
  3. Thanks
    Wikiwi got a reaction from Kurumi in [FYI] Automatically put 'spaces' for credit/debit card inputs.   
    This is a quick tutorial on how to format user input for credit/debit cards.

    First, we would need to add Header & Footer on your submission form and uncheck HTML editor. Once, done kindly put the code below inside the Footer.
     
    <script> var input = document.getElementById("textfield_ID"); var ctr = 0; input.unsafe = function () {     var key = event.keyCode || event.charCode;          if (key == 8 || key == 46){         if(input.value.length > 0){             ctr = input.value.length-1;         }     }     else {         ctr = input.value.length+1;         if(((ctr % 5) == 0) && ctr <19){             input.value += ' ';         }     } } </script>
    Once that is done, don't forget to set the maximum character limit for your Credit/Debit card field to 19. 

    This should result to something like this:

     

  4. Like
    Wikiwi got a reaction from kpcollier in [FYI] Automatically put 'spaces' for credit/debit card inputs.   
    This is a quick tutorial on how to format user input for credit/debit cards.

    First, we would need to add Header & Footer on your submission form and uncheck HTML editor. Once, done kindly put the code below inside the Footer.
     
    <script> var input = document.getElementById("textfield_ID"); var ctr = 0; input.unsafe = function () {     var key = event.keyCode || event.charCode;          if (key == 8 || key == 46){         if(input.value.length > 0){             ctr = input.value.length-1;         }     }     else {         ctr = input.value.length+1;         if(((ctr % 5) == 0) && ctr <19){             input.value += ' ';         }     } } </script>
    Once that is done, don't forget to set the maximum character limit for your Credit/Debit card field to 19. 

    This should result to something like this:

     

  5. Like
    Wikiwi got a reaction from HowDoYouWannaDoThis in Is there a way to populate multiple, Yes or No filed using a comma-delimited string?   
    If you're looking for a trigger solution then you can use this.

    The trigger above will take your comma-delimited string and check for a "substirng" (in this case one of your choices) if it's in that string. If it did find the specific value then it will return a 1 which is greater than 0 causing the condition to set the value for that Yes/No field to True.
  6. Like
    Wikiwi reacted to cheonsa in Can I remove blank fields on my notification email?   
    You may also check this link: 
     
  7. Like
    Wikiwi got a reaction from Tubby in How to separate a value in a semicolon-delimited value.   
    Just wanted to share this workflow that I used to get a specific data from a field that uses ';' to separate inputs. 
    Ex input: Manager;Donald Duck;Donald@gmail.com
    The formula below will show the 2nd input (Donald Duck) as an output if it detects at least 2 ';' are inside the string and if it only detect 1 or less ';' it will output a blank field.
    CASE 
    WHEN Charindex(';',[@field:Original_value], 0) > 0 AND Charindex(';',[@field:Original_value], (Charindex(';',[@field:Original_value])+1)) > 0 THEN Substring([@field:Original_value], (Charindex(';',[@field:Original_value], 0)+1), (Charindex(';',[@field:Original_value], (Charindex(';',[@field:Original_value])+1))-Charindex(';',[@field:Original_value], 0)-1))
    WHEN Charindex(';',[@field:Original_value], 0) = 0
    THEN ''
    END
    table snippet:

    Just a note: You can edit this formula to check for other delimiters not just ';'
  8. Like
    Wikiwi got a reaction from kpcollier in How to separate a value in a semicolon-delimited value.   
    Just wanted to share this workflow that I used to get a specific data from a field that uses ';' to separate inputs. 
    Ex input: Manager;Donald Duck;Donald@gmail.com
    The formula below will show the 2nd input (Donald Duck) as an output if it detects at least 2 ';' are inside the string and if it only detect 1 or less ';' it will output a blank field.
    CASE 
    WHEN Charindex(';',[@field:Original_value], 0) > 0 AND Charindex(';',[@field:Original_value], (Charindex(';',[@field:Original_value])+1)) > 0 THEN Substring([@field:Original_value], (Charindex(';',[@field:Original_value], 0)+1), (Charindex(';',[@field:Original_value], (Charindex(';',[@field:Original_value])+1))-Charindex(';',[@field:Original_value], 0)-1))
    WHEN Charindex(';',[@field:Original_value], 0) = 0
    THEN ''
    END
    table snippet:

    Just a note: You can edit this formula to check for other delimiters not just ';'
  9. Thanks
    Wikiwi reacted to KG360 in Can I interrupt a submission when 2 fields have the same data?   
    A million thanks Wikiwi - this is a fabulous solution, I have been looking for a solution to block submission on bad input./G
  10. Like
    Wikiwi got a reaction from KG360 in Can I interrupt a submission when 2 fields have the same data?   
    You can create a simple formula inside a virtual field that will check if both dates are the same with something like this:
    case when [@field:Date1] = [@field:Date2]
    then 'ERROR'
    else 'GOOD'
    end
    You can hide this virtual field when testing is done. Next, you need to add a Header and Footer and add the following JavaSrcipt code at the Header:
    <script type="text/javascript">
    document.addEventListener('BeforeFormSubmit', function(event) {
    var Input1 = document.querySelector("span[id^='cbParamVirtual1']").innerHTML
    if (Input1 === 'ERROR') {
    event.preventDefault();
    alert('Your Dates have the same value');

    });
    </script>
    Make sure to disable HTML editor and replace cbParamVirtual1 with the respective virtualfield name ex. If you're using Virtual3 for this formula then it should be cbParamVirtual3.
    You can also edit the alert to display any message you want. The "event.preventDefault();" will prevent submission of the current input.
     
     
     
  11. Like
    Wikiwi got a reaction from Kurumi in Can I interrupt a submission when 2 fields have the same data?   
    You can create a simple formula inside a virtual field that will check if both dates are the same with something like this:
    case when [@field:Date1] = [@field:Date2]
    then 'ERROR'
    else 'GOOD'
    end
    You can hide this virtual field when testing is done. Next, you need to add a Header and Footer and add the following JavaSrcipt code at the Header:
    <script type="text/javascript">
    document.addEventListener('BeforeFormSubmit', function(event) {
    var Input1 = document.querySelector("span[id^='cbParamVirtual1']").innerHTML
    if (Input1 === 'ERROR') {
    event.preventDefault();
    alert('Your Dates have the same value');

    });
    </script>
    Make sure to disable HTML editor and replace cbParamVirtual1 with the respective virtualfield name ex. If you're using Virtual3 for this formula then it should be cbParamVirtual3.
    You can also edit the alert to display any message you want. The "event.preventDefault();" will prevent submission of the current input.
     
     
     
  12. Like
    Wikiwi got a reaction from kpcollier in Can I interrupt a submission when 2 fields have the same data?   
    You can create a simple formula inside a virtual field that will check if both dates are the same with something like this:
    case when [@field:Date1] = [@field:Date2]
    then 'ERROR'
    else 'GOOD'
    end
    You can hide this virtual field when testing is done. Next, you need to add a Header and Footer and add the following JavaSrcipt code at the Header:
    <script type="text/javascript">
    document.addEventListener('BeforeFormSubmit', function(event) {
    var Input1 = document.querySelector("span[id^='cbParamVirtual1']").innerHTML
    if (Input1 === 'ERROR') {
    event.preventDefault();
    alert('Your Dates have the same value');

    });
    </script>
    Make sure to disable HTML editor and replace cbParamVirtual1 with the respective virtualfield name ex. If you're using Virtual3 for this formula then it should be cbParamVirtual3.
    You can also edit the alert to display any message you want. The "event.preventDefault();" will prevent submission of the current input.
     
     
     
×
×
  • Create New...