Jump to content

TWIRED

Caspio Ninja
  • Content Count

    81
  • Joined

  • Last visited

  • Days Won

    1

Reputation Activity

  1. Like
    TWIRED got a reaction from subraasingapore in Login Times   
    Thanks Mathilda,
     
    "..  a separate table for history of logs and then create a submission form and receive user's ID and other datapa from authentication fields, then add auto-submit script. After that, you may specify in authentication to redirect user to that datapage and then after form is submitted, redirect user to the user's dashboard. "
    it worked
     
     
  2. Like
    TWIRED reacted to Mathilda in Login Times   
    There is a feature called user logs, which allows to see this info. You may check here if your plan has this feature. Another option, you may create a separate table for history of logs and then create a submission form and receive user's ID and other datapa from authentication fields, then add auto-submit script. After that, you may specify in authentication to redirect user to that datapage and then after form is submitted, redirect user to the user's dashboard.
    It may sound a little bit complex, however it's easy to do.
    Please feel free to ask if something is not clear enough. 
  3. Like
    TWIRED reacted to DesiLogi in Copy image field from one table to another in Submission form   
    Hi Twired,
    Thanks for the tips on this- I do understand re an image not being stored in the table but instead the path to that image is stored and then the image grabbed to open (that's how I used to set up my Access databases with image files). I believe what you're suggesting above is referencing the original image via a joined table in a View. Unfortunately, this isn't what I need to do. I need to actually duplicate the image into the new table. 
    This is because the data in one table is used as a reference point to add records to another table but beyond that the are not relatable. As in table1 is a 'Catalogue' with records to draw from. Those records are used (sometimes) to populate records in table2 'Items' which are actual physical 'items and work' on a project. Once a record is in the Items table it is independent and can be changed in many ways. Likewise, the Catalogue record that was used to first 'create' the Items record can and will be changed. The image may be changed along with other information- but the 'Items' record that was made for it needs to NOT change also (because it is now an independent entity). Meaning if an image in the Catalogue record is changed then the image in the related Items record must NOT also change. So a View with joined tables would not work for this. 
    This isn't a relational database 'don't duplicate data' issue- in this particular case I do actually need to duplicate some records, instead of using FKs. 
    Hence, my query about how to duplicate the image into the new table. As per your explanation above, I was hoping to be able to duplicate the image path to the new table, into the image field. Because users enter data in this table in a few ways, manually as well as by copying from the 'Catalogue' table- so images need to be in a single field for displaying purposes. I can't have a field for manual upload when a record is manually created, and a separate (text) field for a 'copied' record from the Catalogue. The image field is used all over the app and if there are 2 fields (one an image field, one a text field from copying) it will not work in many (complicated) displays. 
    So the fact that an image file must be user-uploaded (thanks for pointing that out) means that I can't copy the image path itself into an 'image' field, only to a text field. So that's a no-go, unfortunately. 
    I had Caspio do some custom work on duplicating records in this way but was hoping to avoid that expensive and time-involved route, if possible. If I come across a solution I'll definitely post it here for others. Also, thanks again for your help on this- much appreciated either way. 
     
  4. Like
    TWIRED reacted to diversity in Multi Select Listbox (Submission Form) - On Error - Javascript Code Required   
    Ok it works now, thank you so much guys
  5. Like
    TWIRED got a reaction from diversity in Multi Select Listbox (Submission Form) - On Error - Javascript Code Required   
    HI Diversity,
     
    As Mathilda mentioned,
    you have to hit "Source" button (in footer) 
    and then paste the code in.
     
    Also,
    Hold down Control key when selecting from the listbox.
     
     
     
  6. Like
    TWIRED reacted to kRv in Use javascript to access caspio data via caspio SOAP API   
    Because you need provide your credentials each time when you create API call, you need create some proxy page on the server and call API from server-side. In JS you can communicate with proxy just create some proper request without any security information.
  7. Like
    TWIRED reacted to verdyathome in Web Services question   
    In fact with a little more detective work and light bulb going on inside my head I have managed to resolve the issue myself. For those who maybe interested the answer is below:-
    The answer really was not so much in VBA, but how to manage variables in SQL statements, once I understood this a quick internet search provided the answer.
    obj.wsm_UpdateData TextBoxAccountId.Value, TextBoxProfile.Value, TextBoxPassword.Value, _
    TextBoxTableName.Value, False, "Trl_No", TrailerNoField, "route = '" & RouteField & "'"
    Seem to have save myself $150 minimum in Caspio developer support charges. So worth the extra effort.
    Regards
    Simon
  8. Like
    TWIRED reacted to DesiLogi in Check text field for null in javascript if then   
    Hi TexterVaid,
    Thanks for the suggestion- I wasn't able to get it to work using that for some reason. I fiddled around and finally got the code to work- it seems Caspio is somewhat random as to what js works with its data fields. 
    Removing the parseFloat, changing the if clause a bit (I tried 'else if' as suggested but just the 'else' ended up working) and making the fields 'hidden' seemed to get it right:
    var v_lk = document.getElementById("EditRecordmstrSuppliers_LinkedIn").value; if(!(v_lk) == "") { Thanks again for helping and hope this solution works for someone else too- 
  9. Like
    TWIRED reacted to ezIQchad in Id="caspioform" Scroll Height   
    Hello,
    Another formatting trick!
     
    I previously had challenges getting Caspio Forms to scroll properly. Then I learned about viewport in CSS -> https://web-design-weekly.com/2014/11/18/viewport-units-vw-vh-vmin-vmax/
    #caspioform {   overflow: auto;   height: calc(100vh - 96px); } I use calc() to take into account the header. If you use calc the spaces between the values and the operator(-,+,*,/) is required.
  10. Like
    TWIRED reacted to cgonzalezalcala in Multiple Submissions Of Form In One Page   
    Try this. After hours of googling came across it. Used on wordpress.
    <script>
    function submitallforms() {
    setTimeout('document.forms[0].submit()',100);
    setTimeout('document.forms[1].submit()',200);
    setTimeout('document.forms[2].submit()',300);
    }
    // End -->
    </script>

    <input type=button value="Submit" onclick="submitallforms();">
  11. Like
    TWIRED reacted to rstglobal in Consequesnce for changing field names in a table   
    The question was answered via email but I post it here for everyone's future reference:
    Dear Graeme,
    Thank you for contacting Caspio Support. You are asking very good questions.
    1. Updating field names in table is automatically reflected in DataPages as well, however there a few things to note when you change a field name in the table.
    • Field name in the table is different than the field label that you see in the DataPage (form and reports). Therefore if you change a field name in the table, the field label in DataPages remain unchanged. If you want to update the labels, you need to edit each DataPage and change the label in the Configure Fields wizard screen.
    • If you have used field parameters in the DataPage inside HTML blocks or Header/Footer or in JavaScript coding (if you have any) such as [@field: Course_name] then you will need to update those manually in each DataPage.
    2. DataPage names could be updated as you wish. If you have references to the updated DataPage in other DataPages, the references will be updated automatically.
    3. When you change data types you need to note a few things:
    • Changing data types may remove data if the data does not match the new data type. For example, if you change text255 to date/time, you need to make sure the data is in date format (mm/dd/yyyy). When you change the data type, system generates warning before performing the action, we recommend you read the warning details and take necessary action before confirming the update.
    • Changing data types also may remove the field from the DataPages; you will need to edit the DataPage and add the field back. If you change text255 to text64000, the field stays intact however from one type such as Text to another such as Number, will remove the field from DataPage.
    Regards,
    Caspio Support
  12. Like
    TWIRED reacted to DesiLogi in Custom Submit button with url destination in html block   
    Thanks for posting this- I need to play around with it to make it applicable to my particular scenario but this is a good place to start. 
  13. Like
    TWIRED reacted to Mathilda in Receiving Parameter for - Encrypted Password Field   
    Hi Texter,
    Data in password fields are encrypted and can't be passed as a parameter. You  may try using text field as a password and pass value to a field in form#2. You can show values in the field on the form #2 like ***, this setting can be found in the field options settings. (Show as password ***)
    Hope that help
  14. Like
    TWIRED reacted to DesiLogi in Update different Fields based on Virtual field value   
    I ended up using the above and some other code for if/then to get it to work. Here's the solution in case anyone else needs it:
     
    <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var productid = document.getElementById("cbParamVirtual1").value; if (productid == 3){ var x = document.getElementById("cbParamVirtual2").value; document.getElementById("EditRecordmyTextfield1").value = x; } else if (productid == 1){ var x = document.getElementById("cbParamVirtual2").value; document.getElementById("EditRecordmyTextfield2").value = x; } else if (productid == 2){ var x = document.getElementById("cbParamVirtual2").value; document.getElementById("EditRecordmyTextfield3").value = x; } else if (productid == 4){ var x = document.getElementById("cbParamVirtual2").value; document.getElementById("EditRecordmyTextfield4").value = x; } else if (productid == 5){ var x = document.getElementById("cbParamVirtual2").value; document.getElementById("EditRecordmyTextfield5").value = x; } else if (productid == 6){ var x = document.getElementById("cbParamVirtual2").value; document.getElementById("EditRecordmyTextfield6").value = x; } } document.getElementById("caspioform").onsubmit=concatenate; </SCRIPT>  
  15. Like
    TWIRED reacted to RkaydianFlower in Parse Comma Delimited Data In Field   
    I have a similar issue, but on a Submission DataPage, and I don't need any preselection. Using javascript I was able to create a multi-select listbox that stores the user’s selections as comma-separated values in a single line:
     
    writer, director, actor, producer
     
    Now I would like to create a Search List DataPage that allows users to search this data using a listbox like this:
     
    writer
    director
    actor
    producer
     
    Currently, the comma-separated values from each user’s submissions show on a single line. How can I get these values broken up onto separate lines of the listbox on a List DataPage?
     
     
     
  16. Like
    TWIRED reacted to MayMusic in Select multiple values from a listbox in a update DataPage   
    If you have more than one listboxes on your details or update user this code
    <script> // Function for selecting corresponding elements from the list box. function select_ (){ // get listbox element var o_els = new Array("EditRecordFIELDNAME","EditRecordFIELDNAME2","EditRecordFIELDNAME3"); for (var k=0; k< o_els.length; k++ ) { var o_el = document.getElementById(o_els[k]); // Enable multiselect for listbox o_el.multiple="multiple"; // get listbox length var len = o_el.options.length; // get selected element var selected = o_el.options[len-1].value; // verify if selected element contains comas, if yes, do the following if (selected.indexOf(",") != -1 ){ // Split selected option into array var m_array = new Array();m_array=selected.split (","); // Delete last option from the listbox o_el.options.remove(len-1); // Go through listbox and select each option, if it is present in array for( var i=0; i< m_array.length; i++ ){for( var j=0; j< len-1; j++ ){ // Trim spaces while comparing elements from array and listbox if( m_array[i].replace(/^s+|s+$/g, '') == o_el.options[j].value ){ o_el.options[j].selected = "selected"; } } } } } } // call select_ funtion when details page is loaded window.onload = select_; </script>
  17. Like
    TWIRED reacted to wgalliance in Js: Checkboxes For Multi-Optioned Entries   
    I need this function for one of my datapages but the difference is that I have an update form which needs to store the separate checkbox fields so I cannot use virtual fields. Can this script be used with actual checkbox fields rather than virtual fields?
  18. Like
    TWIRED reacted to MayMusic in Questions A Bundled   
    1) How Can I Change the Default "View Details" link to just "Details"?
     A: Edit the localization you are using for this page, under Results Pages >> Record Actions >> Element find view details and change the custom text
     
    2) Grid Edit - How Can I Make the tables NOT shrink and get squishy when I Click "Grid Edit" :
    A: Add Header to "Configure Result Page Fields" screen and use the code below:

    <style>
    .cbGridCtnr, .BodyCtnr, .Table {
    width: 100% !important;
    }
    </style>
  19. Like
    TWIRED reacted to Mathilda in Multiple Page Form Submission & Auto-Submit Issue   
    Hi, thanks for sharing
  20. Like
    TWIRED got a reaction from Mathilda in Multiple Page Form Submission & Auto-Submit Issue   
    Got it to work  hope this helps someone.
     
     
    AUTOSUBMIT
    MULTIPLE PAGES (Submission forms )  TO 2 TABLES in a Parent-Child Relationship
     
    Tables are in a Parent-Child Relationship

     
    Submission Form-  Destination setting - URL of Autosubmit form
    AutoSubmit Form - Destination setting - Display a Message
     
    Tips
          In the First Submission Form
    You dont need to create a virtualID element to pass the Primary Autonumber key.
            It gets sent by default.
     
        In the Auto Submit Form (2nd data page)
    Make sure  the Foreign Autonumber Key  and any Unique Keys  are not hidden or in display mode, they should be as regular Fields. Dont hide them or they wont work.
     Make sure all of the above fields  receive parameters or the form wont submit due to incomplete required fields
      The other fields you can leave hidden.
     In the Autosubmit form , the fields and submit button can  be hidden with  nodisplay tags in an HTML Block and also by using a Different Localization


     
         Passing parameters in 1st Submission form
    The Most Important thing  while passing/receiving parameters use INSERTRECORDfieldname;
    Even in javascript for getElementById use INSERTRECORDfieldname
    Otherwise nothing works.


     
    Script That Finally worked and just submits once (doesnt loop)
    -----------------------------------------
    <script type="text/javascript">
    var tacyidvalue;
    tacyidvalue=document.getElementById('InsertRecordTacyID').value;
    if(tacyidvalue !=='')
    {
     document.getElementById("caspioform").style.display = 'none';
     setTimeout('document.forms["caspioform"].submit()',1000);
     
    }
     
    </script>
     
  21. Like
    TWIRED reacted to caspio in JS Guide: Caspio Form Elements   
    JavaScript Tips: Caspio Form Elements
     
    JavaScript is a client-side scripting language that is commonly used in HTML pages. JavaScript can be used in Caspio Bridge DataPages to extend capabilities outside the standard features. This page provides a guideline for referencing Caspio form elements using JavaScript. It is an advanced topic and you should have prior knowledge of JavaScript programming.
     
    Referencing Caspio Form Elements
     
    A common way to access a form element using JavaScript is by referencing the element's ID attribute using:
              -   document.getElementById("id")
    The value in the field can be referenced using:
              -   document.getElementById("id").value
    In the following sections, we will list the ID attributes for Caspio form elements in various DataPages.
     
    Submission Forms
    Text Field/Text Area/Dropdown/Checkbox/Listbox/Hidden:           -   InsertRecordFIELDNAME
              -   FIELDNAME should be replaced with your field name.
              -   For example: document.getElementById("InsertRecordFirst_Name")
    Radio Button: A radio button includes multiple options and each option has an associated ID. The ID is a name followed by a number:           -   InsertRecordFIELDNAMEX
              -   X is the radio button option order, which starts at 0 and increments based on the order of each radio option.
     
             For example if your radio button has three options: Red, Blue, Green
              -   Red is InsertRecordFIELDNAME0
              -   Blue is InsertRecordFIELDNAME1
              -   Green is InsertRecordFIELDNAME2
    Virtual Field: cbParamVirtualX           -   X is the virtual field in the form, which starts at 1 and increments based on the number of the virtual fields in the form.
              -   For example: document.getElementById("cbParamVirtual2") is referring to the second virtual field.
    Cascading Dropdown: Cascading dropdown and its parent dropdown are referenced by name since the ID changes on every page load. To reference cascading dropdown and its parent dropdown, use the following format:           -   document.getElementsByName("InsertRecordCompany_Name")[0]
              -   Note that in the above format, the number 0 never changes.
    Display Only: These are not fields but span tags, therefore they don't have an ID. Details and Update Forms
     
    Details and Update Forms use the same rules and naming conventions as Submission Forms (in previous section), except that InsertRecord is changed to EditRecord.
              -   EditRecordFIELDNAME
              -   For example: document.getElementById("EditRecordFirst_Name")
              -   Note that Virtual Fields and Display Only rules are the same as Submission Forms (in previous section).
     
    Search Forms
    Text Field/Text Area/Dropdown/Checkbox/Listbox/Hidden:           -   ValueX_Y
              -   X is the form element order, which starts at 1 and increments based on the order of the element in the form.
              -   Y is the criteria. It starts at 1 and increments based on the criteria order. It is always 1 if the field has no extra criteria.
    Radio Button: ValueX_Y[Z]           -   Z is the radio button option order, which starts at 0 and increments based on the order of the each radio option.
    Virtual Field: The rules are the same as Submission Forms (in previous section) Cascading Dropdown: This element should be referenced by name as explained in the previous section. The name of the element is ValueX_Y. Distance Search By ZIP/Postal Code:           -   Center of Search: cbDsField1
              -   Distance: cbDsField2
    Distance Search By Coordinates:           -   Center Latitude: cbDsField1
              -   Center Longitude: cbDsField2
              -   Distance: cbDSField3
     
    Authentication/Login Forms
    Text Field: xip_FIELDNAME           -   FIELDNAME should be replaced with your field name.
     
     
    Referencing Forms
    To access Caspio Forms/DataPages, you can reference the ID using:           -   document.getElementById("caspioform")
     
    Note that all Caspio DataPages share the same id as "caspioform". Therefore if there are multiple DataPages deployed on the same page, you need to reference them in a different way such as:
     
              -   document.forms[X]
     
    X starts at 0 which refers to the first form on the page and increments based on the order.
     
    To access Caspio Authentication or Login Forms, use:           -   document.getElementById("xip_DataSourceName")
              -   Replace "DataSourceName" with the name of data source used in your Authentication.
     
     
    Referencing Buttons
    Submit Button: Submit Update Button: Mod0EditRecord Delete Button: Mod0DeleteRecord Search Button: searchID Back Button: Mod0CancelRecord Login Button: xip_datasrc_DataSourceName           -   Replace "DataSourceName" with the name of data source used in your Authentication.
     
    Where to Place the JavaScripts
     
    In Forms, place your code in an HTML Block. The HTML Block should be the last element in the list.
     
    In Results, place the code in the Header or Footer unless you want the code to be executed for every record.
     
    Quick Tips
     
    If you need to reference an element that is not listed in the above document, try using F12/Developer Tools available from most browsers such as IE, Firefox, and Chrome. Developer Tools help web developers inspect the elements on the web page to find the related ID and also debug JavaScript code if necessary using the Console tab. For more information, check online for available tutorials using your browser's Developer Tools.
    In the meantime, you can see examples of JavaScript solutions in the community forum.
  22. Like
    TWIRED reacted to MayMusic in Can I Import From Excel File Through Datapage   
    If you want them to feed the table without having access to Caspio you can request for datahub which is a scheduled import/export task. User can put the file somewhere like a FTP site and Caspio can be programed to run for instance every hour to import the data. Using this feature you can either replace the table or append the data to the table
     
    If you want to let them update certain records then you can try web services http://www.caspio.com/extend/platform-extensions/web-services.aspx if you know programming.
  23. Like
    TWIRED reacted to ezIQchad in User Authentication Counter   
    Yep,
    Set up an AutoSubmit [http://forums.caspio.com/index.php/topic/4314-js-auto-submit-a-datapage/] DataPage that fires after logging in...
     
    Then simply create a report DataPage to display the data however you want.
  24. Like
    TWIRED reacted to aam82 in Using Wordpress Login For Caspio Too   
    I address it this way: I have a few Caspio user classes, say user, superuser, admin. All datapages that use the "user" authentication, are embedded on wordpress "User" template-based Pages. The User template, in turn calls a specific WP "User" menu. So I have 3 authentications, 3 Page templates, and 3 menus.
    Finally, and I'm embarassed to say it: since these WP menus are NOT behind Caspio authentication, public users who guess a URL of one of your pages could see the menu, but obviously not the datapage embedded on the page. Still, I don't like that, so I have a script that looks for a DIV in my authentication form, and if present, hides the WP nav with CSS. Pretty nasty, and not really that effective, but it beats using 3 Caspio datapages for 3 menus.
  25. Like
    TWIRED reacted to caspio in Js: Auto-Submit A Datapage   
    JavaScript Solution: Auto-Submit a DataPage
     
    Feature Description:
    This JavaScript solution shows how to auto-submit a DataPage. Caspio DataPage only submits to one table so if you need to perform submission to multiple tables you can use another DataPage and the following JavaScript to auto submit.

    Implementation:
    This solution can be used "as-is", without any changes if 
    a. It is used in a Submission, Single Record Update, or Details DataPage and
    b. The DataPage is the only one Caspio DataPage deployed on your web page.
    c. The "progress_bar" image exists on your site: www.yoursite.com/images/progress_bar.gif. Or the URL should be adjusted to where your file is located.


    To use this solution, copy the code below and paste inside the HTML Header section of the DataPage using the Caspio Bridge DataPage Wizard.
     
    <div align="center"> <p>Processing...</p> <img src="images/progress_bar.gif" alt="Progress Bar" width="200" height="15" /> </div>  
    Then insert an HTML Block, copy the code below and paste inside the HTML Block section:
     
    <script type="text/javascript">   if(document.getElementById("caspioform")) {   document.getElementById("caspioform").style.display = 'none';   setTimeout('document.forms["caspioform"].submit()',1000); }  </script>  
    In  submission successful message area, click on Source button and paste the code below.
    <style type="text/css"> #processing{ display:none; } </style>  
    Tested Browsers
    This JavaScript solution was tested on the following platforms and Internet Browsers only.
    # MS Windows - IE 10, Firefox 25.0.1, Chrome 31.0.1650.57, Safari 5.1.7

    Disclaimer: Use these JavaScript solutions at your own risk! They are provided to assist you in the customization of your programs and while we believe they work properly, by using them you accept all responsibility about them and confirm that they are not a feature of Caspio's platforms and as such are provided "as is" without any warranties, support or guarantees. 
×
×
  • Create New...