Jump to content


Caspio Guru
  • Posts

  • Joined

  • Last visited

  • Days Won


Community Answers

  1. douvega's post in Passing Caspio Multi-Select Data to FormStack via Zapier was marked as the answer   
    Replace your code with this:
    <script type="text/javascript"> function f_listbox(fieldObj) { //Set field to multi-select fieldObj.multiple = true; //Get field values var values = fieldObj.value; if (values.indexOf(",") > 0) { for (var i=0 ; i < fieldObj.options.length; i++) { if(fieldObj[i].value == values) { fieldObj.remove(i); break ; } } var arr = values.split(", "); for (var j=0 ; j < arr.length; j++) { for (var i=0 ; i < fieldObj.options.length; i++ ) { if(arr[j]== fieldObj.options[i].value){ fieldObj.options[i].selected = true; break ; } } } } } setTimeout(f_listbox(document.getElementById("YOUR:FIELD:ID")), 20); </script>  
  2. douvega's post in Can you hide an HTML block with a rule? was marked as the answer   
    I just came with another idea that should work, this is by using your current HTML block content.
    Create a section for these two elements, Specific LSN time: and your HTML block Message. Go to Rules in your Datapage and create a new Rule. If the radio is not equal to Specific, then hide the section that contains the field and the HTML Block That would be pretty straight forward. You can learn more about this way in this article
    Hope it helps.
  3. douvega's post in Display Image Conditionally In Header was marked as the answer   
    You can use JavaScript for that. Although, there are existing articles for solving this, I understand some of us wants to have a specific and quick solution so let me try to answer that for you here.
    You need to use JavaScript to make your sites dynamic. In this case, try by adding the following HTML/JavaScript in the header.
    <div id="linksContainer"></div> <script> var linkDiv = document.getElementById("linksContainer"); var imgOne = '<a href="http://www.inmetriks.com/greenmark/audit/audits-view-only/?Section=1&Audit=[@field:GM_Questionnaire_ID_GM_Questionnaire_ID#]"><img alt="Generated button" src="https://dabuttonfactory.com/button.png?t=1.+Enviro.+Management&f=Calibri&ts=18&tc=fff&hp=10&vp=5&c=3&bgt=gradient&bgc=8dff4d&ebgc=26ce61&bs=2&bc=000" /></a>'; var imgTwo = '<a href="http://www.inmetriks.com/greenmark/audit/audits-view-only/?Section=3&Audit=[@field:GM_Questionnaire_ID_GM_Questionnaire_ID#]"><img alt="Generated button" src="https://dabuttonfactory.com/button.png?t=3.+Waste&f=Calibri&ts=18&tc=fff&hp=10&vp=5&c=3&bgt=gradient&bgc=8dff4d&ebgc=26ce61&bs=2&bc=000" /></a>'; var imgThree = '<a href="http://www.inmetriks.com/greenmark/audit/audits-view-only/?Section=4&Audit=[@field:GM_Questionnaire_ID_GM_Questionnaire_ID#]"><img alt="Generated button" src="https://dabuttonfactory.com/button.png?t=4.+Travel&f=Calibri&ts=18&tc=fff&hp=10&vp=5&c=3&bgt=gradient&bgc=8dff4d&ebgc=26ce61&bs=2&bc=000" /></a> '; var imgFour = '<a href="http://www.inmetriks.com/greenmark/audit/audits-view-only/?Section=&Audit=[@field:GM_Questionnaire_ID_GM_Questionnaire_ID#]"><img alt="Generated button" src="https://dabuttonfactory.com/button.png?t=5.+Procurement&f=Calibri&ts=18&tc=fff&hp=10&vp=5&c=3&bgt=gradient&bgc=8dff4d&ebgc=26ce61&bs=2&bc=000" /></a>'; var imgFive = '<a href="http://www.inmetriks.com/greenmark/audit/audits-view-only/?Section=6&Audit=[@field:GM_Questionnaire_ID_GM_Questionnaire_ID#]"><img alt="Generated button" src="https://dabuttonfactory.com/button.png?t=6.+Local+Environment&f=Calibri&ts=18&tc=fff&hp=10&vp=5&c=3&bgt=gradient&bgc=8dff4d&ebgc=26ce61&bs=2&bc=000" /></a>'; //1 is being treated as string (for your specific case, I would prefer this way) but in case you need to do number comparisions, then you should call your field as number. if('[@field:GM_Level_ID]' == '1'){ linkDiv.innerHTML = imgOne + imgTwo + imgThree; } else { linkDiv.innerHTML = imgOne + imgTwo + imgThree + imgFour + imgFive; } </script> Let us know if it works.
  • Create New...