Jump to content

Search the Community

Showing results for tags 'conditional'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Caspio Bridge
    • General Questions
    • Caspio JavaScript Solutions
    • Tables, Views and Relationships
    • Import/Export and DataHub
    • DataPages
    • Deployment
    • Security, Authentications, Roles, SAML
    • Styles and Localizations
    • Parameters
    • API and Integration
    • Calculations and aggregations
    • User JavaScript and CSS Discussions

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


MSN


Website URL


ICQ


Yahoo


Skype


Location


Interests

Found 15 results

  1. I have a table with a field named Total_Time with a function datatype, that calculates total time using the flowing formula.. Round(((([@field:End_Hour] - [@field:Start_Hour]) * 60 + ([@field:End_Min]-[@field:Start_Min])) - (([@field:Break_Fin_Hour] - [@field:Break_Start_Hour]) * 60 + ([@field:Break_Fin_Min]-[@field:Break_Start_Min]))) /60 ,2) This works as expected… Now I would like to add a conditional statement that checks the value of the field "Assigned_Tech" and if the value is “Summary” then leave the Total_Time field blank, else run the formula. Im thinking.. CASE IF ([@field: Assigned_Tech])!==”Summary” THEN Round(((([@field:End_Hour] - [@field:Start_Hour]) * 60 + ([@field:End_Min]-[@field:Start_Min])) - (([@field:Break_Fin_Hour] - [@field:Break_Start_Hour]) * 60 + ([@field:Break_Fin_Min]-[@field:Break_Start_Min]))) /60 ,2) END Can someone please help me with the correct case statement to use. I spent 2 days writing the total_time formula and now am in a bit over my head using conditional statements in the formula. Thanks in advance for any an all help
  2. i have a primary key ID and several other fields: locatio, customername, crew, etc and a field called datecompleted. when the date completed field has a value I want to change all the other field to a color "red" any help would be appreciated. Isuck at coding.
  3. I have a HTML datapage which is the user' s main menu to my app. Now I would like to test whether the user is restricted in it's use of the first of four menu items. I have the following code, but it returns "file or directory not found" when I preview it and choose the 1st menu item: <script> window.onload = testFormRes; function testFormRes() { var dynLink; if ("[@authfield:Restricted^]"=="yes"){ dynLink="https://c0ect240.caspio.com/dp.asp?AppKey=eeda30004146e1be17fe4f64a319"; } else{ dynLink="https://c0ect240.caspio.com/dp.asp?AppKey=eeda3000a155f226d27146b0ae20"; } } </script> <div id="menu-mobile"> <div id="row"> <h1><i>[@authfield:Cust_Name]</i></h1> <h2>Main Menu - Res</h2> </div> <div id="row"> <div id="mobileNavagtion"> <ul> <li><a href=("dynLink") class="btnPatrolForm">ActivityForm</a></li> <li><a href="https://c0ect240.caspio.com/dp.asp?AppKey=eeda3000a31708e7da464d9e9b63" class="btnPostOrders">Post Orders</a></li> <li><a href="https://c0ect240.caspio.com/dp.asp?AppKey=eeda3000d7e592f401a541d4b948" class="btnReportsMain">Reports</a></li> <li><a href="https://c0ect240.caspio.com/folderlogout" class="btnLogout" class="btnLogout">Logout</a></li> </ul> </div> </div> </div> As one can probably detect, I am a novice at coding, any help would be appreciated! Richard
  4. I want to make a datapage element be visible or hidden depending on the value of another datapage element. How to do?
  5. Hi everyone, I'm fairly new to the world of JavaScript and have the following scenario on a submission page: During submission, my users select a business client using an AutoComplete field. Once they selected a client, two virtual fields pull two values for this client from an external table. These lookups are set up using cascading text field. On the same DataPage, there is a radio button with two options. Should the two virtual fields remain blank (basically meaning that there is no value for either of the fields for this client in the external table), the 2nd radio button option should be selected and the field hidden to prevent user interaction. The hiding and selection part works fine, but it seems that I'm not able to get the value from the virtual fields and my script stops working as soon as I add the condition that involves the value of any of the two virtual fields: <script type= "text/javascript"> function AMFCheck() { var AMF1 = document.getElementById('cbParamVirtual12')[0].value; var AMF2 = document.getElementById('cbParamVirtual13')[0].value; if (AMF1 == "" && AMF2 == "" ) { document.getElementById("InsertRecordAMF_payable1").checked = true; document.getElementById("InsertRecordAMF_payable").style.display = "none"; } } document.getElementById("caspioform").onchange=AMFCheck; </script> I'd be really grateful for any help. Thanks, Christof
  6. I've found a number of sort of related posts on this but nothing exact that I need. I have a tablular datapage with an internal Details page option that sends an Acknowledgement email for Update/Insert records. Works well except I need the user to be able to 'choose' whether to send the acknowledgement (or notification) email by checking a virtual field (check box). This is so an email doesn't go out every single time there's an edit- it only needs to go out when the users decides to by checking the virtual field. I'd like to possibly be able to use something like this on: -and Inline Insert of a tabular datapage (though I don't think it could be virtual field then, perhaps I could put a check box in the data source table) -a Bulk Edit popup But the Details form of a tabular datapage is the first place I need to start. This seems like it should be a standard feature of CB because email notifications shouldn't go out every time an edit is made unless desired. Any help on this would be great- thanks.
  7. I have a submission form that cascades data results in several virtual fields. The virtual fields reside within sections that either hide or display those elements depending on their results. What I would like to do is have all the elements that are not hidden display on the same line. Unfortunately only the elements within each section have the advanced option to “continue next element on the same line”. Is there a way to display all elements and submit button all on the same line? I tried removing the sections thus allowing me to display all elements on the same line, but with some elements being hidden the table that displayed the elements would jump around. For example.. if virt1,virt4, and virt5 are displayed on a search, then on the next search virt4 and virt5 were hidden and only virt1 and virt15 are displayed, virt15 is displayed on the far end several spaces away from virt1. Providing an undesirable result of the table cells jumping around with each search.
  8. I am creating a datapage where my clients can make request for the time and date of a specific inspection. In order to be able to coordinate the inspectors I have to limit the time that the requests are made, therefore I need to create a condition that does the following: to process the request online then the request has to be made at the latest the prior business day before by 5:00 pm (local time) For example today is Tuesday at 6:00 pm local time, therefore the earliest inspection available is for Thursday since is already after 5:00 pm to request for tomorrow. I am intermediate user that have created a significant application but I don't have programming knowledge, so any help is really appreciated.
  9. Hello, I have a Search and Results web page (simular to what is described here.. http://howto.caspio.com/tech-tips-and-articles/parameters/add-a-search-interface-to-results-sets-page ). The web page has a search submission form and two different results data pages (report1 and report2), both results pages receive parameters from the submission form and display tabular reports on the web page as expected. So far so good. The first virtual field in the submission form is a dropdown that offers the selections "report1 and report2, passing that parameter as [@report] on exit. How can I display/hide the results pages depending on the [@report] parameter received. Any and all suggestions are greatly appreciated.
  10. Can anybody tell me what I need to do to make data entry into an input field conditional on a checkbox being check or not? I have a service parts catalogue table in my app. When users key in a new part code into the input datapage they have to check a checkbox (or not) to indicate whether the part code is serviceable or not. If serviceable, then I would like to force them to have to enter a from and to date. How can I enforce this? Any help would be much appreciated
  11. ok I am really hoping someone can help on this one... it seems easy I just can't seem to get it! I have a conditional field (PO) that based on a flag is hidden (RequirePO flag when set to false the PO field is hidden), but what I really want to do is if the flag is false hide the field, if it is true require the field.... It look like the rules in Caspio can either hide it or require but I cant do both (I even tried setting two rules but it looks like if you use a field in a rule it cant be used again)... maybe a javascript solution?
  12. I am trying to conditionally show/hide HTML elements based what type of user is logged in. I’m not too familiar with how Caspio sessions are handled and how they relate to my HTML pages. I also have very little Javascript experience. There should be three levels of access, Admin, Manager, and User. I currently have an authentication table that has three users and three yes/no fields (admin/manager/user), each user is a different type. My first idea was to use cookie data. On successfully logging into my authentication form it would make a cookie for user type which would have a value of admin, manager, or user. Then I could use that cookie to add the display:none style to certain elements that I don’t want lower access users viewing. My problem is that I’m not sure how to do that with Javascript, or if that is the best practice. I currently have an HTML Datapage linked to my Authentication. On that page is this code: var type_admin = '[@authfield:admin]'; var type_manager = '[@authfield:manager'; var type_user = '[@authfield:user]'; if (type_admin == "Yes") { document.cookie="type=admin"; } else if (type_manager == “Yesâ€) { document.cookie="type=manager"; } else if (type_user == “Yesâ€) { document.cookie="type=user"; } Then I assume I would just reference the cookie on my HTML pages somewhat like this: <div class="adminContent"> Show this content if the user is Admin </div> <div class=â€managerContentâ€> Show this content if the user id Manager </div> <div class=â€userContentâ€> Otherwise show this content </div> Here are the HTML/PHP files I’m working with: http://domco.us/vita/test/ And here is the login page that’s just an embedded Datapage: http://domco.us/vita/page_login.php In the end I would like to be able to filter things like navigation buttons or div blocks. It would be great to have an Admin Tools link in the navigation that only Admins/Managers could see. I’m not sure the specifics of getting something like this to work. Also I don’t know how to keep that @authfield data throughout different HTML pages (not linked to Caspio) and I’m just assuming Cookies are the best option. Any help would be greatly appreciated.
  13. Hi guys, i need a small help! I'm passing a var data to an html page trough this script: var data = { registry: "[@authfield:registry^]", }; [@authfield:registry^] is a checkbox field, so it returns YES/NO. Now i need a more complex code. I would like to set something that do it: if { ([@authfield:registry^]= Yes & [@authfield:record^]= Yes) registry= Yes} else { registry = No } May somebody help me to fix this code? Thanks in advance Ezio Grieco
  14. How can I show an error message if the amount entered in a submission page is less than a certain value?
  15. When user selects a specific title from a dropdown I want to send a specific email to him. How can I do that?
×
×
  • Create New...