Jump to content

Search the Community

Showing results for tags 'javascipt'.

  • 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 13 results

  1. Hi, can anyone help me? I have been using the code below without issue on an Caspio HTML data page, but am having issues when I add it to an HTML block in a report. <button class="block" onclick="document.location='https://--myURL--? UniqueProjectID=[@UniqueProjectID]">MY URL</button> When I add the button to a report, the report seems to automatically activate the update_event (even without this button, or the update button being pressed). If I change the button's to hyperlinks, that I block up to look like a button, this seems to get round the issue, but really I would like to still use buttons. Changing responsive or AJAX doesn't solve the issue, and if the change the configure settings to stay on the same page after update, the page just blinks every second on a continuous refresh
  2. I am trying to dynamically set a Yes/No field in addition to redirecting a user after completion of a submission page. This is the code that I have in the Destination Page. Virtual1 captures the type and YesNoVariable is the flag that I want set. What I've done below does provide the right redirection based on the Virtual1 value but the value to set the YesNoVariable to true (or checked) does not. <script type="text/javascript"> if("[@cbParamVirtual1]" == "Adoption") { document.getElementById("InsertRecordYesNoVariable").checked=true; window.location = "http://page1?ProfileID=[@field:ProfileID]&ProfileFullName=[@field:ProfileFullName]"; } else if("[@cbParamVirtual1]" == "Foster") { window.location = "http://page2"; } else { window.location = "http://otherpage"; } </script> Appreciate fixing my code and any help in understanding how to properly set this value. Thanks in advance.
  3. Hi, I'm trying to use js to get the user's system date/time on their local computer, in the Bulk Edit section of a tabular datapage. I've used this code in various other datapage types but cannot get it to work in the Bulk Edit footer. In the footer of Bulk Edit, the field is Comments_Actual_Read_Date but it's not capturing the v_TimeStamp value. Does Bulk Edit need something besides EditRecord to reference a field? Here's the code I've got: <SCRIPT LANGUAGE="JavaScript"> /* Declaration and initialization */ Stamp = new Date(); var v_TimeStamp; Hours = Stamp.getHours() Mins = Stamp.getMinutes(); /* Attach a prefix with digit '0' if the minutes is less than 10. */ if (Mins < 10) { Mins = "0" + Mins; } /* Construct the value of the v_TimeStamp variable in the format m/d/yyyy hh:mm */ v_TimeStamp=('' + (Stamp.getMonth() + 1) +"/"+Stamp.getDate() + "/"+Stamp.getFullYear() + ' ' + Hours + ":" + Mins); /* Field name - Date_Charge is referred with a prefix - EditRecord */ document.getElementById("EditRecordComments_Actual_Read_Date").value = v_TimeStamp; </SCRIPT> EDIT: Ah, I found a post showing you use 'BulkEdit' instead of 'EditRecord' but now the issue is if js is used to populate the Bulk Edit field it doesn't check the left column 'select' box automatically so the user has to do it manually. This defeats the purpose and is clunky. Is there a way to 'select' the field in Bulk Edit using js?
  4. Hello! I have been trying to get this signature box to work with a responsive submission form but i can´t get it to work, it shows up in the form and i can draw in the box but it doesn´t save to the table. It works fine if I disable responsive and ajax. Does anyone have any ideas to solve this? Kind regards / Chrille
  5. Hi everyone, How can copy the text from the selected drop-down element to the text field? Thanks for looking into. Regards, vitalikssssss
  6. hello i need to resize all images in user form before submissions , client side not server side after submissions probably javascript code that resize all images in the form any idea about that or any other alternative
  7. I am trying to add Javascript to validate/limit the acceptable date range for a tabular inline add. I have tried several suggestions from various forum posts, but cannot get it to work. I started with this code as a form of this does work in a different application (https://forums.caspio.com/topic/16261-validate-field-value-before-submit-in-tabular-search-report-both-table-and-details/). Please help. <script> var nameOfField = "InlineAddDate"; document.addEventListener('DOMSubtreeModified', function(){ if(document.getElementsByName(nameOfField)[0]) { document.getElementsByName(nameOfField)[0].addEventListener('change', function(){ var cash = document.getElementsByName(nameOfField)[0].value; var sDate = new Date(cash); var prevMonday = new Date(); prevMonday.setDate(prevMonday.getDate() - (prevMonday.getDay() + 6) % 7); var nextSunday = new Date(); nextSunday.setDate(nextSunday.getDate() + (0+(7-nextSunday.getDay())) % 7); if (sDate < prevMonday || sDate>nextSunday){ alert("Enter a valid date between the previous Monday and the next Sunday."); document.getElementsByName(nameOfField)[0].value=""; document.getElementsByName(nameOfField)[0].focus(); }); } }); </script>
  8. How do I redirect a user to a login page if the user is not logged in? There is already question similar to this one but it doesn't have a clear answer.
  9. As it is right now, a data page with a calendar only has 2 options, monthly and weekly. Is there a way to create a calendar that only shows 3 Days at a time? Sincerely, Jared
  10. Hello, I'm new to Caspio. I have an Update Form with a calculated field called "Total_Percentage", that takes the values from other fields. Code below: Isnull([@field:PointFactor_Duties_PercentDuty1],0)+Isnull([@field:PointFactor_Duties_PercentDuty2],0)+Isnull([@field:PointFactor_Duties_PercentDuty3],0)+Isnull([@field:PointFactor_Duties_PercentDuty4],0)+Isnull([@field:PointFactor_Duties_PercentDuty5],0)+Isnull([@field:PointFactor_Duties_PercentDuty6],0) What I would like to do is to prevent users from going forward when their total exceeds 100%. I also, would like to show them, which field(s) is/are causing this field to go over the threshold of 100%. The rules section is not conducive to this goal, as rules section is limited. Triggered action section forces me to either email or text the users if their total exceeds 100%. I don't want to do this, since the whole point is for users to correct errors immediately. Is there anyone out there who can impart me a script or two to help me? SQL or javascript that would work with Caspio. Thank you so much. Emme
  11. I would like to change the attributes of the drop down. Color, padding etc. I don't like the blue color. Thank you for any help!
  12. Hi all, I'm fairly new to javascript and I'm working on this frequent buyer website. What I'm trying to do is to submit the form multiple times base on user input. I have this code: <SCRIPT> document.addEventListener('BeforeFormSubmit', function (event) { var countx = document.querySelector('[id*=Purchase_count'); for (var i=1;i < countx.value;i++) { document.getElementById("caspioform").submit(); } }) </SCRIPT> Is there a reason why it's not working properly in google chrome but works fine on Edge? Here's my datapage: https://c1abc789.caspio.com/dp/3dca7000a203fdee67e14f3ebfa1 Feel free to submit some test records. Thanks in advance for any help I can get on this.
  13. Hello, In a tabular datapage I need to show/hide a field (text64000) that contains html markup and needs to display as html. I use a div id to isolate each record in the tabular datapage's recordset. Then I use an 'if' statement to check the values of 2 fields in that record ("field1" and "field2"). If both criteria are met I need to then show the text64000 field ("field3") in html format. If both criteria are NOT met I need it to show nothing. The below code works to check "field1" and "field2" and then show a value in the span, either a typed in text value or a normal text field for that record. The problem is when I try to use the field that contains the html markup ("field3" in this example). It doesn't show anything (is blank). I know the "if" statement is working because I've tested it with other fields, just showing the field in html is the problem. Does anyone know how to tweak this so "field3" will show in html? I tried putting it in a div instead fo a span but that didn't work either. Any help would be greatly appreciated. <div id="mydiv[@field:MyRecordUniqueID]"></div> <SCRIPT LANGUAGE="JavaScript"> if (("[@field:myfield1]" == "SHOW") && ("[@field:myfield2]" == "active")) { document.getElementById("mydiv[@field:MyRecordUniqueID]").innerHTML ="<span>[@field:myfield3!]</span>"; } </script>
×
×
  • Create New...