Jump to content


Caspio Ninja
  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by kRv

  1. Hello DesiLogi, I cannot check your script right now, so it is just my opinion. I think that your script does not works, because you use invalid names for inline fields. Please pay your attention, that prefix for inline insert fields is InlineAdd, and for inline update it is InlineEdit, but it isn't InsertRecord. Thanks
  2. Hello Farnsbarnes, May you please place code below to you parent page, to "onmessage" event handler? Just replace "f.src = f.src;" to code below. I hope it will help. In case if it does not fix the issue with old data, can you please post link to you parent page? If it isn't acceptable, just send link to parent page to me via forum message. try { f.src = f.src.replace(/[&][t][=][0-9]+$/gi, '') + '&t=' + String(new Date().getTime()); } catch (e) { } Thanks
  3. Hello peterhanse, Password cannot be blank. If you didn't write any value when add new row, system will generate random password. Sure. Please add Header & Footer to your Update DataPage, and place code below to DataPage footer. Please pay your attention, that if user already did change own password, she open Update DataPage second time, and password fields will cleaned on page's load, it is required enter password every time when data will changed, Otherwise password will be override with random value. <script type="text/javascript"> var pwd = document.getElementById('EditRecordPwd'); //place real ID here if(pwd){ pwd.value = ''; } var pwdc = document.getElementById('EditRecordPwd@Confirm'); //place real ID here, but keep @Confirm suffix if(pwdc){ pwdc.value = ''; } </script> I'm not sure which kind of issue you have with it. Please edit your DataPage, go to "Fields configuration", select you password field(s) and uncheck "Require current password validation". Thanks
  4. Hello Farnsbarnes, Yes, you can. For reload particular iframe, you need to correct your code. On your parent page, in "onmessage" event handler replace line below location.reload(); to several new lines var f = document.getElementById("Frame2"); //Set real id f.src = f.src; Thanks
  5. kRv

    Datapage Display

    Hello AndyWallace, Yes, it is possible. You can choose between predefined criteria Report DataPage and Direct to Details DataPage. In both cases you just need select specific search type - "filter data based on your pre-defined criteria". In this case you can pre-configure and static values for criteria or set up DataPage to receive external parameters. Please see for more details http://howto.caspio.com/datapages/reports/creating-a-report-datapage/ Thanks
  6. Hello Farnsbarnes, Can you tell me please, do you use different domains for parent page, and for iframe? If yes, proposed solution cannot works due to security restrictions. Can you please open browser console, and look for some run-time errors, when you submit form in iframe? Can you see some error with similar text? "SecurityError: Blocked a frame with origin..." If you have similar error, you can use some different technique based on messages. Please pay your attention that it will works in modern browsers only. You can see list of supported browsers here http://caniuse.com/#search=postMessage Add code below to header on your parent page: window.onmessage = function (e) { if (e.data === "refresh") { location.reload(); } }; Add code below to footer in your DataPage, which will open via iframe. <script type="text/javascript"> document.getElementById("caspioform").onsubmit = function () { if (window.parent && window.parent.postMessage) { window.parent.postMessage("refresh", "http://bridge.caspio.net"); //put your own domain here } } </script> Thanks
  7. Hello MTF, Can you tell me please, which kind of deployment method do you use? Embed? Also please tell me which kind of data type your field has. Thanks
  8. Hello Farnsbarnes, Please see example below. If user will select one or more values from Select control, and will click "Open" button, all values will be passed to popup page. According to your questions: >> should I attach [@sitelink] , or the field name, to the parameter? You should use [@sitelink] parameter to build proper URL to popup page. I.e. [@sitelink] + '?prm1=123&prm2=456. If you already have question mark in [@sitelink], just replace it ampersand (&). >>being a virtual field, should it be written as cbParamVirtualfield Yes. Please look at following post for more details. http://forums.caspio.com/index.php/topic/4377-js-guide-caspio-form-elements/ You can see example here https://c2ebv261.caspio.com/dp.asp?AppKey=b4d84000415472099e8b44d0891a Parent page <script type="text/javascript"> var states = []; var abc; function f_OpenPopup() { //reference to popup window var popup; //link to popup page var url = '[@app:popupUrl]'; // put parameter instant of string literal var queryStarted = url.search(/\?/g) > -1 ? true : false; //build query string based on user's selection var query = f_GetQueryStringForMultiple(); //check that query string not empty if (query) { //open popup and pass some parameters to it popup = window.open(url + (!queryStarted ? '?' : '') + query); // do something when popup will be closed popup.onbeforeunload = function () { alert(abc); } } } function f_GetQueryStringForMultiple() { var ctrl = document.getElementById("Value1_1"); //Change it to actual field Id var q = ""; if (ctrl) { for (var i = 0; i < ctrl.options.length; i++) { if (ctrl.options[i].selected) { q += (i > 0 || queryStarted ? "&" : "") + "prm=" + encodeURIComponent(ctrl.options[i].value); states.push(ctrl.options[i].value); } } } return q; } </script> Popup page <script type="text/javascript"> if(window.opener && !window.opener.closed) { // get reference to input on parent page var pc = window.opener.document.getElementById("def"); // set some value to input if (pc) { pc.value = 200; } // set some value to variable window.opener.abc = 100; document.write('Following states were select on parent page: ' + window.opener.states.join(', ')); } </script> Thanks
  9. Hello Farnsbarnes, I'm not sure that I understand correctly what you would like to achieve, but let me explain overall case, how to pass parameter between parent page and popup. And your last code example does not makes sense, because you try use not variable, but string literal. 1) To pass parameter to popup you can add it to query string <!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title></title> <script type="text/javascript"> var abc; function foo() { //open popup and pass some parameter to it var popup = window.open('/a/b.html' + '?prm=' + abc); // do something when popup will be closed popup.onbeforeunload = function() { alert(abc); } } </script> </head> <body> <input type="button" value="Open" onclick="foo();" /> <input id="def" type="text" value="" /> </body> </html> 2) Pass some values from popup to parent page <script type="text/javascript"> if(window.opener && !window.opener.closed) { // get reference to input on parent page var pc = window.opener.document.getElementById("def"); // set some value to input if (pc) { pc.value = 200; } // set some value to variable window.opener.abc = 100; } </script> Thanks
  10. Hello asimmons, Bridge always creates Excel XML file, when you choose "MS Excel Spreadsheet (XML)" as file format. I think your user has some issue with file associations. Can you ask she try repair Office installation? Thanks
  11. Hello aukinfo, No, it isn't possible. But you can create feature request on IdeaBox site http://ideabox.caspio.com/ Thanks
  12. Hello wgalliance, HTML element "form" doesn't have "onchange" event. Also after change variable "a" you didn't set it back to "value" property of input element. Please add this script to footer of authentication which you use. <script type="text/javascript"> function nophyphen() { var ctrl = document.getElementById("xip_UserId"); if (ctrl) { ctrl.value = ctrl.value.replace(/-/g, ""); } } var xip = document.getElementById("xip_UserId"); if (xip) { xip.onchange = nophyphen }; </script> Please pay your attention, that you need to change "xip_UserId" to correct name of your field. You can see example below https://c2ebv261.caspio.com/dp.asp?AppKey=B4D84000c0990f53c7f4496d8943 Thanks
  13. Hello egilley, It is a bit late, but I would like add some comments. >>I'm so sorry, but I don't understand what you're showing me and how it will help me with the javascript and getting the statement I want to drop into a hidden field I did show to you example, which write something to hidden field if value in specified field meet some conditionals If you open details page for record with ID 1, nothing happened, because value of Int32 record equal zero. But if you will open any other records, you will see some message, generated via script. As I understand it is exactly what you would like to achieve. >>it seems I can't use "EditRecordNameofField" unless the field is an active field within that datapage Excuse me, but it isn't correct. All DataPage's field, include all hidden fields, follow name convention described above. So, on Submission DataPage all customer's field have prefix InserRecord, and on Update\Details page all customer's fields have prefix EditRecord. There is only one exception - on Update\Details DataPage Display Only fields don't have input element at all, but they have it on Submission DataPage. Probably you got some another issue with script. Glad to see that your issue was resolved. May be this link also will helpful for you http://howto.caspio.com/datapages/forms/conditional-forms/ Thanks
  14. Hello egilley, I'm not sure what kind of issue you got with details DataPage, but quick example, which I create myself, works for me. Please see link to similar DataPage below https://c2ebv261.caspio.com/dp.asp?AppKey=B4D840008d0048954b094c07a106 For make sure that we on same page, may you please post link to your DataPage? I will look on it, and will try figure out how I can help to you. Thanks
  15. Hello egilley, According to your last question - hidden fields are hidden fields on any type of DataPages. Every time they translated to regular HTML elements (<input type="hidden" />) According to your first question, I think there is some data type issue. Please pay your attention, that following code will create string variable, but not numeric var issue5a = '[@field:issue_5_a]'; But below you are trying use it as numeric variable if (issue5a > 0) { Please try change initialization of "issue5a" variable to following var issue5a = Number('[@field:issue_5_a]'); Hope it will help. Thanks
  16. Hi NarayanJr, In your case, composite unique index, create by four mentioned fields, is right solution, but Caspio don't support unique indexes by default. You can contact with support team and ask about some PS development. Also if this feature important for you, please post new idea on Caspio IdeaBox If you want know more technical details please see following link Unique Indexes Thanks
  17. Hi tclemendor, I think your issue related to old session cookie. Please try remove all cookies for following domains: caspio.net, caspio.com and all subdomains (i.e. bridge.caspio.net) Settings -> "Show advanced settings..." -> Privacy (Content settings) -> "All cookies and site data..." -> add filter by Caspio Hope it's help
  18. If your data can contain and apostrophe and double quotes, you can write value to some hidden field in HTML block, and read value in script later. It is more right way, because it will work in both cases. But if you just want avoid "apostrophe issue", you can use variant offered above.
  19. You can implement this task by two standard ways: Hide When Blank option, enabled for each field Rule based on parameter which hide some sections on DataPage Please see below example of DataPage with rules. Standard View http://bridge.caspio.net/dp.asp?AppKey=8d36000037642b5aafed4d4fb9f3 Print View http://bridge.caspio.net/dp.asp?AppKey=8d36000037642b5aafed4d4fb9f3&Print=1
  20. MayMusic, I'm sorry for late answer. I think Caspio branding enabled for your account. In this case proposed solution won't work, because Caspio form placed into additional outer table. I think, some script which will found branding table and set proper style settings for it can help you. Please look at script below. Add HTML block to DataPage, move block to the bottom, and put following code: <input id="myAnhor" type="hidden" value="" /> <script type="text/javascript"> try { var v_parent = document.getElementById('myAnhor'); while (v_parent.tagName.toUpperCase() != 'FORM') { v_parent = v_parent.parentNode; } if (v_parent) { var brandingTbl = v_parent.getElementsByTagName('table')[0]; if (brandingTbl) { brandingTbl.style.cssText = 'width: 400px; margin: 0 auto;'; } } } catch (v_e) { } </script>
  21. 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.
  22. Small addition. If document already has some handler we need keep it and execute. Please look at code bellow. var prevKeyPress = document.onkeypress; document.onkeypress = function(e) { if(!e) { e = window.event; } try { if (prevKeyPress) prevKeyPress(e); } catch (ex) { } // Do something }
  23. It is possible center form without iframe deployment. Please open linked style, enable advanced options, and go to Forms/Details -> Layouts. Go to Source tab and add 'width: 400px; margin: 0 auto;' to definition of class cbFormOuterTable.
  24. You can add JavaScript code to HTML block or to Header and Footer. All field names in the DataPage, correspond to the following rule: New Web Form - name has a prefix InserRecord; Update/Details Web Form - name has a prefix EditRecord; The name of the virtual field for all types of pages has a prefix cbParam; Name field on the Search & Password recovery DataPages, based on the following formula: prefix "Value" + field display order + _ + field criteria display order. For example, if you have one field with one criteria on search page, field name will be "Value1_1". <script type="text/javascript"> alert(document.getElementById("InsertRecordStateName").value); </script>
  25. You should replace charAt(0).value at charAt(0). Add this script to HTML Block. It must be the last element on the page. <script type="text/javascript" language="JavaScript"> function getfirst() { var firstletter = document.getElementById("InsertRecordFirst_Name").value; document.getElementById("InsertRecordfl").value = (firstletter) ? (firstletter.charAt(0)) : ''; } document.getElementById("caspioform").onsubmit=getfirst; </script> Hope this helps
  • Create New...