Jump to content

Mathilda

Caspio Rockstar
  • Content Count

    464
  • Joined

  • Last visited

  • Days Won

    49

Posts posted by Mathilda

  1. On 11/10/2017 at 3:29 PM, Clint said:

    I have a long search form with a number of optional checkboxes that are necessary when needed, but infrequently used. 

    Is there a way I can place an additional search button at the top of the page so users don't have to scroll to the bottom to perform a search?

    Thanks!

    try placing the following code in an html block above all the fields:

    <input type="submit" name="searchID" id="searchID1" value="Search" class="cbSearchButton">

     

  2. Hi,

    I modified script from this article. 

    Code for the header:

    <div id="cbwrapper">

    Code for the footer:

    </div><script type='text/javascript'>
    var lat_id = 'EditRecordlat';
    var lng_id = 'EditRecordlng';
    var address_id = 'EditRecordAddress';
    var city_id = 'EditRecordCity';
    var state_id = 'EditRecordState';
    var zip_id = 'EditRecordZip';
    var wrapper_id = 'cbwrapper';
    var msg1 = 'Please input a valid address';
    if(typeof jQuery != 'undefined'){
    var cb_geocoder = cb_geocoder = new google.maps.Geocoder();
    $('#'+wrapper_id+' input[id=Mod0EditRecord]').click(function(e){
    e.preventDefault();
    var add = $('#'+address_id).val();
    var city = $('#'+city_id).val();
    var state = $('#'+state_id).val();
    var zip = $('#'+zip_id).val();
    if(!add || !city || !state || !zip){
    alert(msg1);
    }else{
    var full = add +','+city+','+state+' '+zip;
    cb_geocoder.geocode({address: full}, cbCallBack);
    }
    });
    }else{
    document.write('This Datapage require Standard Caspio Deployment for full functionality.');
    }
    function cbCallBack(locResult){
    if(locResult != "" && locResult.length>0){
    var lat1 = locResult[0].geometry.location.lat();
    var lng1 = locResult[0].geometry.location.lng();
    lat1 = Number(lat1);
    lng1 = Number(lng1);
    $('#'+lat_id).val(lat1);
    $('#'+lng_id).val(lng1);
    $('#'+wrapper_id+' form').submit();
    }else{
    alert(msg1);
    }
    }
    </script>

    Code for the html file where the datapage is deployed:

    <script type="text/javascript" src="https://lib.caspio.com/pub/jquery/jquery.js"></script>
    <script src="//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&key=YOUR_KEY" async="" defer="defer" type="text/javascript"></script>

    You should place those two lines above the deploy code of the datapage.

    Paste your google apikey instead of: YOUR_KEY

    Cheers!

  3. 14 hours ago, rickin21 said:

    Hi Mathilda,

     

    Sure that could work, however my datapage is grouping each person's record, I would need the calculated field to show up in this grouped column and not in each individual records. How would I do this?

    Hi, since we cannot create a button or link in grouping, you need to place the link in each record

    If you don't want to display value of calculated field, you could hide the calculated field using css, like in this post

  4. On 11/4/2017 at 7:26 AM, bookish said:

    HI! Live support is off on weekends. I have this problem I hope someone can help me. I get this error message in my site--- wp-content/plugins/caspio/classes/class-datapage-loader.php on line 4   i deleted the plugin 1.9 and uploaded the Caspio deploy plugin Version 2.0 but it still appears.

    Hi

    Try  adding <?php session_start(); ?> at the beginning of the "class-datapage-loader.php" file. Also, please remove any trailing spaces at the beginning of that file. You may find more details here

  5. On 11/2/2017 at 7:13 PM, 74Systems said:

    How do I hide the submit button when the data in a dropdown is blank and show when it chooses one of the two values? Currently I have a dropdown that says "Ready to place an order?" and when clicked, you have two options: "Order Now" or "Call for Payment." I want the submit button hidden until they make one or the other choices. Thank you in advance!

    You may insert my script in the footer of the submission form

    <script>
    
    function hide() {
    
    var v_value = document.getElementsByName("InsertRecordFieldName")[0].value;
    
    if (v_value.length<1){
    document.getElementById("Submit").style.display="none";
    }
    else{
    document.getElementById("Submit").style.display = "inline-block";
    }
    }
    window.onload = hide;
     document.getElementsByName("InsertRecordFieldName")[0].onblur=hide;
    
    </script> 

    Use your field name instead of: FieldName

  6. On 9/22/2017 at 12:38 AM, JoeB62 said:

    Is it possible to mail merge to Microsoft Word?  I've seen articles on the Office Plugin, but that seems to involve a data download.  Is it possible to mail merge on a record level?

    As far as I remember MS plugin is not available for MS Word, it gets data only for Excel and Access.

    You may have a look at 3rd party apps in zapier, perhaps mail chimp provides needed pattern

  7. On 11/2/2017 at 5:43 AM, Scott said:

    I have a field in a dataform. [@field:Rego]

    If a person enters "UNREG" into this filed I would like the field to populate with the [@field:AutoNumber] field on hitting the submission button.

    Any ideas???

     

     

    autonumber field will be populated for every records, therefore you would need to use integer field instead.

    If triggers available for your plan, you can do that using triggered actions, if no - you could use java script. In case of creating java script function I would add a virtual field (drop-down, displaying values, gotten from the table in descending order - this will give you the most recent value) and incrementing a value if value in rego field = unreg

    You may find an example here

  8. 14 hours ago, rickin21 said:

    Hi,

    I am not sure if this is possible or not, but I have a tabular report set up where all the records are grouped under each Full Name (Field name for this table). The table can be collapsed/expanded, but the grouped field will show a total count of each record. 

    I am trying to create a button or something that will create a new record, based on the total count shown. I thought of using triggers for this; however, this seems to only work per record and not when they are grouped. Any suggestions or advise on this would be grateful. I am new to Javascript and CSS so my knowledge is limited on this

    You could get total value using sql query in a calculated field, then you may create a link (find an example here) and pass calculated value parameter in query string

    Hope that helps

  9. Just now, Mylene said:

    Hey everyone 

    I wonder if someone has a solution for resizing an iframe depending on size of content.

    I have an html datapage and need to deploy submission form in iframe and I'd like to avoid scrolling

    Thanks!

    I have a solution for your case. You may find code below:

    <script>https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    
    <script>
      function resizeIframe(obj) {
        obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
      }
    </script>
    
    <iframe  src="URL_of the datapage" frameBorder="0" scrolling="no" width=100% onload="resizeIframe(this)">Sorry, but your browser does not support frames.</iframe>

     

    Don't forget to insert your URL instead of: URL_of the datapage

  10. On 10/12/2017 at 12:54 AM, Bruins said:

    How do I validate an email address like rkazunaga@mednet.ucla.edu validating the @mednet.ucla.edu on a submission form.

    I modified a solution from this post for submission form. You may try using my script in the footer: 

    <script>
    
    function validateEmail(email)
    {
    var email =  document.getElementById("InsertRecordEmail_field").value;
        var splitted = email.match("^(.+)@thisdomainonly\.com$");
        if (splitted == null) 
    return false;
    
        if (splitted[1] != null)
        {
            var regexp_user = /^\"?[\w-_\.]*\"?$/;
            if (splitted[1].match(regexp_user) == null) 
    return false;
            return true;
        }
    
        return false;
    
    }
    
     document.getElementById("caspioform").onsubmit=validateEmail;
    </script>

     

  11. 9 hours ago, Alwayslost said:

    Looking for a script in data pages, where if the phone number doesn't exist, the image presently used for phone number changes... 

    I have a similar script for "Yes/No" fields but don't know how to manipulate it for from Yes/No to Blank/not blank.. Any input is appreciated. 

     

    You may find an example in this post. Hope that helps 

  12. On 10/24/2017 at 2:54 PM, roattw said:

    Thanks Mathilda.  Will try it out and report back.  Would there be a slight alteration to that to not define each option but to instead count all occurrences of any chosen?

    If  "type of music" field is included in your datasource, you may use the following syntax:

    select count(user_id) from table_name where type_of_music=target.[@field:type_of_music]

     

    target.[@field:type_of_music] - this part refers to the field value on report

    Hope that helps

  13. 52 minutes ago, Shane said:

    I'm building a Squarespace site and was all excited when I found that Caspio offered a way to implement a simple database search. Signed up, and in 15 minutes had a working search. Super awesome so far. In the Squarespace editor, you add the embed code in a "code block" on the page. Yesterday, once I had done that, the editor (or the javascript code referenced in the embed code) seemed to recognize I was looking at the page through the Squarespace editor and did not show the form, instead displaying a message about being in edit mode and so forth. That was just fine, as the site worked as expected.

    This morning, I suddenly cannot edit that page in the editor. The normal hover options to edit simply don't appear. Other pages on the site act normally. Also, the search form no longer has the message about being unavailable in edit mode, but instead shows the actual search form. The only thing I can think of is that I started messing with the styles for the form and results on the Caspio side, but I haven't found a way to get it to work again.

    Has anyone seen this before?

    Hi, welcome to forum! :)

    I don't think that this can resolved in caspio account, you may have a look at this article.

    Hope that helps

  14. On 10/11/2017 at 11:21 PM, Scott42 said:

    Hello,

    We're performing a big move from excel based "databases" in to a proper Caspio database.

    We store a lot of customer information such as address. We'd prefer that our customers send us an e-mail to update their address information. However since we're transferring such a large number of users we'd like to give everyone the opportunity to update their data once without e-mailing us. 

    I've created the update form for users, and created an additional field called "CaspioUpdate" in our table to mark whether or not that user has completed the update form or not. My rules on the form appear to work and do not allow the user to update their information if it finds data in the CaspioUpdate column for that user. The trouble I am having is having the CaspioUpdate column update AFTER the user has complete the form. How can we do this? 

    Hi, what is the purpose of updating that field? Can you describe a workflow?

    I suppose that you may need to have a separate datapage for this purpose

  15. On 10/14/2017 at 12:38 AM, roattw said:

    Reporting: simply counting the number of times the choices in a drop down were selected? I have several drop downs on a form. I just need to tally the number of times each of the drop down choices was selected. Cant seem to just get a simple count of each dropdown choice.  In excel its a simple countif= fucntion.  Kinda surprised a robust system like caspio cant do it out of box.

    Example: Form data page question asks people Whats Your Type of Music? Drop down options Rock, Jazz, Hip Hop, Classical. After 6 months I need to tally the number of people that chose Rock, Jazz, Hip Hop or Classical. It would be a very basic Excel countif= function.

    I suppose that you may try using sql count function in a calculated field. E.g.:

    select count(user_id) from table_name where type_of_music='Rock'

  16. 5 hours ago, jrodriguez88 said:

    Good Evening...


    I have created my application to enable users to sign up which leaves a e-mail address and GUID on the table that later requires First Name and Last Name to be mandatory.  However, the mandatory fields that I set as mandatory is not following the rules.   

    Does anyone know how to logically check to ensure that the fields are not null?  

     

    I have provided a example?  

     

    function validateFormOnSubmit(theForm) {
    var reason = "";

      reason += validateUsername(theForm.username);
      reason += validatePassword(theForm.pwd);
      reason += validateEmail(theForm.email);
      reason += validatePhone(theForm.phone);
      reason += validateEmpty(theForm.from);
          
      if (reason != "") {
        alert("Some fields need correction:\n" + reason);
        return false;
      }

      return true;
    }

    Hi

    I found a post which should be helpful.

    Hope that helps 

  17. 12 hours ago, lmooring said:

    Hi, I have a simply one that I just can not figure out. I know it's easy but I haven't been able to get this to work.

    I have a field where the user will enter a date. I want to take that date and add one, then insert into another field on a submission form.

     

    Field Name: End Date (user entered) = 10/23/2017

    Field Name: Expire Date (calculated) = 10/24/2017

     

    Any help would be appreciated.

    You can use formula field with dateadd function:

    DATEADD(dd, 1, [@field:end_date])

    If you prefer JavaScript, have a look at this post, you just need to add 1 day instead of 1 month.

     

  18. On 3/22/2017 at 3:54 PM, MikesBarto2002 said:

    I have a website where I continuously load articles into the browser as the user scrolls down the page. If the user places a Caspio embed in the first article, this will get loaded in on page load, and works great. But any articles that are dynamically created using JavaScript that try to embed Caspio within it don't populate. I am guessing this is because the script for Caspio has already run, and would need to be run again to populate the new instance.

    I followed the instructions to embed into articles. Is there anything in the API that can be called to refresh all Caspio instances on the page, or is this not possible?

    I would hardcode deploy code in js file and load datapage in a specific node on a condition (when page is scrolled to a specific place)

  19. On 10/20/2017 at 6:50 PM, pgjacob said:

    I was wondering if you could conditionally display deploy code based on a passed parameter.  If the parameter = X, then show the deploy code, if not, then hide it.

    thanks

    I would hide  datapage is parameter is not equal to X. You may find an example below:

    <script type="text/javascript">
    window.onload= function my_funct(){
    
    var check='[@param]';
    if (check != 'X'){
      document.getElementById("caspioform").style.display = 'none';  
    }
    }
    </script>
  20. 14 hours ago, NeoInJS said:

    @douvega The impacted Data element is a CASCADING dropdown menu. I don't see an option for it to receive the parameter within the Caspio bridge. I am assuming that this will need a custom JS on windows. onload() to set the Dropdown value to the parameter.

    Only regular drop-down form element can receive a parameter on a submission form. What is the purpose of assigning a parameter to a cascading element?

    First, you may need to submit a parameter to your lookup table. Have a look at this post.

  21. On 10/5/2017 at 6:28 PM, SteveBlake said:

    I have 6 different departments that each work on client projects.  They each want to have their own default lists for phases of new projects, steps within each phase, and tasks for those steps for new projects.  I have separate tables for projects, phases, steps, and tasks.  They want to be able to hit a button to create a new project and have a single page come up that has the project information across the top.  Then below this they want to see their default phases on the left, steps in the middle, then tasks, then the details for that task.  Attached is a screenshot of a mock-up layout from Excel.  I have put a bold border around each section that would populate a different table.

     

    So when they hit the new project button on the menu, they want this page to open up with the names of the phases, steps, and tasks pre-populated from a template.  They then want to be able to change these names, if necessary, and fill in the rest of the information before submitting to update the various tables.  A high percentage of their jobs use the same phases, steps, and tasks so they don't want to have to enter this information for each new project or select it from a drop-down or listbox.  They want it to just automatically be there similar to a template in Excel. 

     

    I am looking at creating another table with these defaults listed by department in combination with an autosubmit page based on their department from the employee table/authentication that would then lead to a results page that can be edited.  However, I am looking for ideas on how to accomplish this. 

    Any ideas or thoughts are greatly appreciated as I have been told that if Caspio cannot do what they consider to be a simple Excel function then they will just continue to use Excel.  Thanks!

     

    Update:  with the release of Bridge 9.9, I am using the triggered action on the project table to easily accomplish this.  Now I just have to figure out how to get the results page to look similar to the attached such that the Phase 1 section is the same height as the Steps for Phase 1 and Step 1 to be the same height as the Tasks for Step 1, etc.

    Screen Shot 2017-10-05 at 11.16.01 AM.png

    I think that you may try using cascading elements, this will let you fill out fields with data depending on value, selected value in a parent field.

  22. 16 hours ago, lmooring said:

    Quick question because I have similar issue.

    What if you wanted the date to appear on the submission prior to the form being submitted? So if the user needed to change the date based on the calculation result they could? A formula field would give you the correct result but is not able to be displayed on the submission form.

    In this case, you may use java script only for displaying the value to a user. Depending on your requirements, you may execute function window.onload or 'onchange' of a specific field.

  23. 16 hours ago, NeoInJS said:

    Thank you @Mathilda. For Submission forms, how can I initialize a regular text field to get the Current day of the week

    In this case you may use java script. I created a simple example for you, you should paste script in the footer of the datapage:

    <script>
    window.onload = function myFunction() {
        var d = new Date();
        var weekday = new Array(7);
        weekday[0] = "Sunday";
        weekday[1] = "Monday";
        weekday[2] = "Tuesday";
        weekday[3] = "Wednesday";
        weekday[4] = "Thursday";
        weekday[5] = "Friday";
        weekday[6] = "Saturday";
    
        var n = weekday[d.getDay()];
        document.getElementById("InsertRecordField_name").value = n;
    }
    </script>

    Enter name of your field instead of: Field_name

×
×
  • Create New...