Jump to content

MayMusic

Caspio Evangelist
  • Content Count

    1,510
  • Joined

  • Last visited

  • Days Won

    73

Reputation Activity

  1. Like
    MayMusic got a reaction from JEllington in Thank You Maymusic   
    Thank you so much for your kind words!
  2. Like
    MayMusic reacted to Olfa in Datapage Destination Parent Frame On Submit   
    setInterval is going to execute your ReloadParent function evry 3 second. in order to reload the parent page only once you have to use setTimeout function.

    Or you can simply use the code bellow
    <script> myFunction() { window.parent.location.reload(); } document.getElementById("caspioform").onsubmit=myFunction; </script> Olfa
  3. Like
    MayMusic got a reaction from Master in Create Link On Fly Based On Dropdown Selection   
    Let's say you have the name and URL in table. Include both to your page
     
    Name: dropdown
    URL: Cascading dropdown
     
    Add a HTML Block right after Name field and have the code below to show the link after selection
    <div id="details"></div> Add one HTML Block above URL field and paste the code below to hide cascading
    <table style="display:none;"><td> One HTML Block below URL and use the code below:
    </td></table> <script> document.getElementsByName('InsertRecordName')[0].onblur= function (){ var URL = document.getElementsByName('InsertRecordURL')[0].value; if (URL){ document.getElementById('details').innerHTML="<a href="+URL+">Details </a>"; } } </script> Replace "InsertRecordURL" and "InsertRecordName" with the actual field names.
  4. Like
    MayMusic got a reaction from jhanajc in Data Usage Thoughts, Tools, Tactics   
    When you open a page from browser, import, export data to Caspio it goes toward your data transfer usage. You can use developer tools like firebug to see how much a page usages for each load. It is under Net tab and look for Size.
     
    You can try to contact your assigned success manager and see if they can wave the developing period over-usage fee for you.
  5. Like
    MayMusic got a reaction from JEllington in Show/hide Results Page   
    Have a div around each report deploy code and give it an ID and hide it, for instance:
     
    Report 1:
    <div id="r1" style="display:none;"> Caspio Deploy code of report 1 </div> Report 2:
    <div id="r2" style="display:none;"> Caspio deploy code for report 2 </div>  And then on the web page have this script below all deploy codes:
    <script> var report = getParameterByName('r'); if (report == 'r1'){ document.getElementById('r1').style.display = 'inline-block'; } else if (report == 'r2'){ document.getElementById('r2').style.display = 'inline-block'; } function getParameterByName(name, url) { if (!url) url = window.location.href; name = name.replace(/[\[\]]/g, "\\$&"); var regex = new RegExp("[?&]" + name + "(=([^]*)|&|#|$)"), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(results[2].replace(/\+/g, " ")); } </script> Note, the destination after submission on search page you have URL to the page where you have deployed your pages in this format:
     
    http://URL?r=[@field:NAME OF THE FIELD USER SELECTS REPORT]
  6. Like
    MayMusic got a reaction from JEllington in Using Rules & Criteria To Selectively Display Certain Fields   
    Also remember that you can add Sections as well, sometimes you use one field and you cannot use it again. In that case, you can add Section for that field use section once and then field itself
  7. Like
    MayMusic got a reaction from JEllington in Caspio Wordpress Comments   
    What I know about wordpress is styling issue I have never heard about passing parameter issue I know wix has issues with passing param and wordpress is breaking styles.
  8. Like
    MayMusic got a reaction from acslakeland in Passing Authentication Through Iframes   
    I have tried to deploy 2 pages as iframe and I still stay in both!!! It should be working as long as you stay in the same browser. I even tried on my phone and it is working fine.
    If you give me the URL to your page I might be able to figure out the issue
  9. Like
    MayMusic reacted to Aurora in Condition Dropdown Values   
    Hi Michelle !
     
    I think I have some similar code. In my case there are 3 values - Done is # 1 in dropdown , which equals [0] in the script, Pending-#2 in dropdown and equals [1] in script, and Canceled-  #3 in dropdown, [2] in script. 
     
    Here is the code: 
    <SCRIPT LANGUAGE="JavaScript"> function calculate() { var dropdown =(document.getElementsByName("EditRecordYour_Field1")[0]); var date1 = new Date(document.getElementById("EditRecordDate_Field").value); var date2 =new Date(document.getElementById("EditRecordDate_Field2").value); if (date1>date2) { dropdown.options[2].selected=true; } if (date1<date2) { dropdown.options[0].selected=true; } if (date1.getTime()===date2.getTime()) { dropdown.options[1].selected=true; } } document.getElementById("EditRecordDate_Field2").onchange=calculate; </SCRIPT> The script works when you change second Date field. 
     
     
    Good luck, 
     
    Aurora
  10. Like
    MayMusic got a reaction from derekcaldwell in Conditional Roll-Over Message On Top Of A Conditional Image   
    You need to change the code to:
    <script> if ("[@calcfield:3]"!="[@field:Current_Pay_Grade]") { document.write('<img width="15px" src="https://umghr-sjecs....images/flag.jpg" />'); document.write("[@field:Current_Pay_Grade]  does not align with [@calcfield:3]. Check each job factor and the grand total."); } </script>
  11. Like
    MayMusic reacted to Xiang in Possible To Color Code Rows By Group In A Tabular Report?   
    Hi MikeP,
     
    How are you?
     
    I've written the code (you can add an HTML Block, place it the last element, click the Source button and enter the code):
    Do not forget to change "id" in two places ([@field:id]) - enter the name of your field with unique value (usually it is a field with the Autonumber DataType) and enter your values in blocks "first possible value", "second possible value". You can use as many blocks as you want.
    <div id="[@field:id]"></div> <SCRIPT LANGUAGE="JavaScript"> var line_id='[@field:id]'; var number_records_per_page = 25; //Records per page var line=document.getElementById(line_id).parentNode.parentNode; var elems = line.getElementsByTagName("td"); var myColor = ""; var mybgColor = ""; var colorAll = false; var comparisonText = ""; if(elems[0].innerHTML==" ") {    var isGroup = elems[0].parentNode.previousSibling.getElementsByTagName("td")[0];    if(isGroup.innerHTML==" ")    {       for(i = 1; i < number_records_per_page; i++)       {          isGroup = isGroup.parentNode.previousSibling.getElementsByTagName("td")[0];          if(isGroup.innerHTML!=" ") break;        }     }    comparisonText = isGroup.innerHTML; } else {   comparisonText = elems[0].innerHTML; } //first possible value if (comparisonText =="test"  || comparisonText =="test (Cont.)")  //enter your value instead of test {    myColor="blue"; //enter your text color instead of blue    mybgColor="yellow"; //enter your background color instead of yellow    var colorAll = true; } //second possible value if (comparisonText =="test" || comparisonText =="test (Cont.)") //enter your value instead of test {     myColor="red"; //enter your color instead of red     mybgColor="green"; //enter your background color instead of green     var colorAll = true; } if(colorAll) {    for (var i=0, m=elems.length; i<m; i++)    {       elems[i].style.color=myColor;       elems[i].style.backgroundColor=mybgColor;     } } </SCRIPT> I'll be grateful, if you tell me if the code works.

    Have a nice day!
  12. Like
    MayMusic reacted to Xiang in Can I Use A Aggregate (Total) In Js In The Footer ?   
    Hi peterhanse,
     
    Welcome to the Forum!
    How are you?
     
    I think, you can use the following code:
    <script> var column_number = 1; var myTable = document.getElementsByName("cbTable")[0]; var myRows = myTable.getElementsByTagName("tr"); var lastRow = myRows.length - 1; var myCells = myRows[lastRow].getElementsByTagName("td"); var myTotal = parseFloat(myCells[column_number].innerHTML); var paard = "voeg uw paard toe!"; var voegtoe = "upgrade uw acount!"; if(myTotal>0) { document.write("<p>Link: " + paard.link("http://google.nl") + "</p>") } else { document.write("<p>Link: " + voegtoe.link("http://caspio") + "</p>") } </script> Where column_number is the number of the Aggregation.
    If you use only one Aggregation, it'll be "1".
     
    I'll be grateful, if you tell me if the code works.

    Have a nice day!
  13. Like
    MayMusic reacted to Xiang in Validate Past And Future Dates   
    Hi everyone,
     
    I'd like to share this code, that validates if the entered date is correct.
    Enter the name of your field instead of "myDate", enter the correct numbers for allowedDaysInPast  and allowedDaysInFuture variables, enter texts of your messages.
    If you don't want to validate in past or in future you can delete the correspond block.
    Then add a Header@Footer element, select the Footer element, click the Source button and enter the code.
    <SCRIPT LANGUAGE="JavaScript"> function validate_dates() { var dateFieldName = "myDate"; var allowedDaysInPast = 1; var deniedMessagePast = "The entered date cannot be earlier than yesterday"; var allowedDaysInFuture = 1; var deniedMessageFuture = "The entered date cannot be later than tomorrow"; dateFieldName = "InsertRecord" + dateFieldName; var entered_value = document.getElementById(dateFieldName).value; var entered_date = new Date(entered_value); //Start of Validating in past var todayP = new Date(); var allowedDatePast = new Date(todayP.setDate(todayP.getDate() - allowedDaysInPast)); allowedDatePast = allowedDatePast.setHours(0,0,0,0); if(entered_date < allowedDatePast)    {       alert(deniedMessagePast);       return false;    } //Finish of validating in past //Start of Validating in future var todayF = new Date(); var allowedDateFuture = new Date(todayF.setDate(todayF.getDate() + allowedDaysInFuture)); allowedDateFuture = allowedDateFuture.setHours(23,59,59); if(entered_date > allowedDateFuture)    {       alert(deniedMessageFuture);       return false;    } //Finish of validating in future } document.getElementById("caspioform").onsubmit=validate_dates; </SCRIPT> I'll be grateful, if you tell me if the code works or if any errors occur.

    Have a nice day!
  14. Like
    MayMusic got a reaction from Aurora in How To Create Image Slideshow In Html   
    You can try to add this to the header
    <script type="text/javascript"> var image1 = new Image() image1.src = "images/image1.jpg" var image2 = new Image() image2.src = "images/image2.jpg" </script> And the code below where you want to show the slide
    <p><img src="images/pentagg.jpg" width="500" height="300" name="slide" /></p> <script type="text/javascript"> function slideit() { var step=1; document.images.slide.src = eval("image"+step+".src") if(step<2) step++ else step=1 setTimeout("slideit()",2500); } slideit(); </script>
  15. Like
    MayMusic got a reaction from derekcaldwell in Pass Paramter From Submission Page   
    If you want to pass the paramter on a button click:
    <script> function newFunction() { var v_param = document.getElementById("InsertRecordFIELDNAME").value; window.open('http://www.site.com/page.html?parameter1='+v_param); } </script> <input type="button" value="click me" onclick="newFunction()" /> If you wanto pass it after form submit, you can pass it through Caspio http://howto.caspio.com/parameters/passing-parameters/
  16. Like
    MayMusic reacted to MayMusic in Expiration Date   
    Add this code to the footer of the page. Make sure to replace "DATEFIELDNAME" with the field name you want to save this expiration date on
    <script> function f_date(){ var v_currentDate=new Date(); v_currentDate.setDate(v_currentDate.getDate() +10); var v_assignDate = (v_currentDate.getMonth() + 1) + "/" + v_currentDate.getDate() + "/" + (v_currentDate.getFullYear()); document.getElementById('InsertRecordDATEFIELDNAME').value = v_assignDate; } f_date(); </script>
  17. Like
    MayMusic got a reaction from NaghmehK in Expiration Date   
    Add this code to the footer of the page. Make sure to replace "DATEFIELDNAME" with the field name you want to save this expiration date on
    <script> function f_date(){ var v_currentDate=new Date(); v_currentDate.setDate(v_currentDate.getDate() +10); var v_assignDate = (v_currentDate.getMonth() + 1) + "/" + v_currentDate.getDate() + "/" + (v_currentDate.getFullYear()); document.getElementById('InsertRecordDATEFIELDNAME').value = v_assignDate; } f_date(); </script>
  18. Like
    MayMusic reacted to zzhwvw01 in refresh results page automatically   
    In case anyone else is interested, it was as simple as adding the following HTML Block in the Configure Results Page Fields.
     
    <META HTTP-EQUIV="refresh" CONTENT="120"> "120" being 120 seconds
  19. Like
    MayMusic got a reaction from wayanmariasa in Field Length   
    This is possible by setting fixed width for results page label and data elements in the style. To do so, follow the steps below:

    1-    Edit the Style and enable "Show advanced options (CSS Source)"
    2-    Move on to the Settings screen and expand Results Page
    3-    Select Label, switch to Source tab and find ".cbResultSetLabel". Add the following:

    display: inline-block;
    width: 70px;

    4-    Select Data and find ".cbResultSetData". Add the following:

    display: inline-block;
    width: 100px;

    You can play with the width number to get the best fit for your page.

    NOTE: inline-block style should NOT be applied to Tabular DataPage labels/data fields.

    *** Changes you make in a style will affect all the pages that are using it. It is strongly recommended to make a copy of the style, apply it to your DataPage and make the changes in the copy one.
  20. Like
    MayMusic got a reaction from lmooring in Result Page In A Pop Up Window   
    Create your search and result pages in two different pages as described here http://howto.caspio.com/tech-tips-and-articles/parameters/how-to-separate-search-page-and-results-page-into-two-different-webpages/  
    In Configure Fields screen of the search page add Hear/Footer to create your customized button using the code below in the Footer: <input type="button" value="Search" onClick="gotoreport();"> <script language="javascript" type="text/javascript"> function gotoreport() { var URL =  "URL OF THE REPORT PAGE?PARAMNAME=" + document.getElementById('FIELD ID').value + "& PARAMNAME=" + document.getElementById('FIELD ID').value;           newwindow=window.open(URL,'name','height=200,width=150');           if (window.focus) {newwindow.focus()}           return false; } </script> You need to replace URL OF THE REPORT PAGE with URL of the report page and PARAMNAME with the parameter name you are receiving in the report page in Configure Filtering Fields screen as described in the tutorial. Also FIELD ID with the real field ID.
     
    To hide the original submit button you can either add display:none; to .cbSubmitButton in the style you are using for this page or add a Header to the page and use:
    <style> #Submit{ display:none; } </style>
  21. Like
    MayMusic got a reaction from lmooring in Validate Based On Date Entered In Submission Form   
    You can try the following code. Make sure to replace 'DATEFIELDNAME' with the real field name in this line: var mydate = document.getElementById('InsertRecordDATEFIELDNAME').value;
    <script>  var TwoWeeksAgo = new Date(); TwoWeeksAgo.setDate(TwoWeeksAgo.getDate() - 14); function chk_date(){ var mydate = document.getElementById('InsertRecordDATEFIELDNAME').value; if ( Date.parse(mydate) <=  TwoWeeksAgo ) { alert('pick a date within the past 14 days'); return false; } } document.getElementById('caspioform').onsubmit=chk_date; </script>
  22. Like
    MayMusic reacted to Jan in Cascading "text Area" Element?   
    It seems, you can find a solution in this topic.
  23. Like
    MayMusic got a reaction from swipebox in Conditional Text On Report   
    You can add an HTML Block to your report and use this code:
    <script> if ("[@field:FIELDNAME]" == "Not Completed") { document.write("<a href='http://caspio.com'> Click Here</a>"); } </script> Replace the link and also FIELDNAME in the code above
  24. Like
    MayMusic got a reaction from reyemmaus in Submission Forms - Sequential Ids   
    Why not using autonumber field which will be creating sequential number itself? 
  25. Like
    MayMusic got a reaction from kme in Timestamp When "y" Clicked   
    <script> var currentdate = new Date(); var datetime = currentdate.getDate() + "/"                 + (currentdate.getMonth()+1)  + "/"                 + currentdate.getFullYear() + " "                   + currentdate.getHours() + ":"                   + currentdate.getMinutes() + ":"                 + currentdate.getSeconds(); document.getElementById('EditRecordSupportReady0').onclick= function () { if (document.getElementById('EditRecordSupportReady0').value == 'Y'){ document.getElementById('EditRecordSupportRequiredYes').value = datetime; document.getElementById('EditRecordSupportRequiredYes').disabled= true; } else if (document.getElementById('EditRecordSupportReady1').value == 'Y') { document.getElementById('EditRecordSupportRequiredYes').value = "" ; } } document.getElementById('EditRecordSupportReady0').onclick= function () { if (document.getElementById('EditRecordSupportReady0').value == 'Y'){ document.getElementById('EditRecordSupportReadyYes').value = datetime; document.getElementById('EditRecordSupportReadyYes').disabled= true; } else if (document.getElementById('EditRecordSupportReady1').value == 'Y') { document.getElementById('EditRecordSupportReadyYes').value = "" ; } } </script> This code should make the visible text field disabled so user cannot change and also to remove the value from hidden text field since if user selects Yes first the date will appear on text field and now if checks no the field is hidden but the value is there so we need to remove the value now 
     
    I have  not tested the code but it should work
×
×
  • Create New...