Jump to content

Search the Community

Showing results for tags 'javascript'.

  • 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

  1. Is it possible to hide entire rows of data in a tabular results page based on a Calculated field Value using JS? Essentially, I have a search and report to return records based on predefined criteria. However, one criteria that I would like to filter by is not stored directly in the table (Table A). It is stored in another table (table B ). So I have a calculated field holding a SQL Query to return a number based on the records from the other table (table B ). I would like to then see if there is a way to hide all records returned that are returned with a Value of 0 from the Table A Tabular report. Is this possible? Additional Information: For several reasons, of which I don't want to waste your time or over-complicate the question, using views to combine the tables in a manner to accomplish is not desired. Nor would a solution dependent on Sorting or Grouped results be sufficient. I really would like to make these results entirely invisible/inaccessible. Thanks in advance for all of your time and assistance. Cooper
  2. Hi all, I want to hide the submit button in a details page based on the value of five calculated fields. I saw this post from before: http://forums.caspio.com/index.php/topic/5131-hide-button-based-on-calculated-field/ Based on the advice there, I came up with the following: <script language="javascript"> var stat='[@calcfield:2]'; if (stat.length='Not Equal, please revise figures') { coauthor = stat; document.write(stat); document.getElementById("Mod0EditRecord").style.display = "none"; } </script> But I have been unable to get that script to work for me properly. As is, it does not hide the submit button but rather shows the button and the text "Not Equal, please revise figures" below the submit button.(see attached) Also, the script is for only one calculated field and I would like the javascript to include five. Any help would be much appreciated.
  3. Hello! I am using a javascript code to change the values of some text fields everytime the user choose a value on a dropdown list at a submission form. This is the code: <SCRIPT LANGUAGE="JavaScript"> function atualizacampos() { var text1 = document.getElementById('InsertRecordEntidades_Canais_Info_1'); var text2 = document.getElementById('InsertRecordEntidades_Canais_Info_2'); var text3 = document.getElementById('InsertRecordEntidades_Canais_Info_3'); var text4 = document.getElementById('InsertRecordEntidades_Canais_Info_4'); var dropC = document.getElementById('InsertRecordEntidades_Canais_ID_Canal_Doacao'); var Cselecionado = dropC.options[dropC.selectedIndex].text; switch(Cselecionado) { case 'Depósito Bancário': text1.value='Agência' break; case 'Nota Fiscal': text1.value='Número da Nota'; break; case 'Paypal': text1.value='Código Paypal'; break; default: } } document.getElementById('InsertRecordEntidades_Canais_ID_Canal_Doacao').onchange=atualizacampos; </SCRIPT> This is already working, but right now i am trying to change also the labels of those text fields. I already tried some sibblings options, but it did not work. Can you guys please tell me the correct code to achieve that? So everytime a user change the dropdown value, the text1.value will be changed and also the label associated with this field will be changed for a new value. Can someone please help? My best regards, Shidartha
  4. I'm using a details page to update a record in my table & on the details page are a variety of calculations that i've written to calculate "onchange" on the page. Things are working properly, however now i'd like to disable the sumbit button if "Field_A" & "Field_B" do not match. To add a layer to this, i'd like to know how to use an HTML block as one of these fields since it's where the calculation happens and i'd also like to know if i can have multiple criteria that disable the submit button. I'm thinking that I need to assign a field name to the HTML block, however I don't know how to do that unfortunately. How would the code for this situation be written? "Field_A" value must equal "HTML block 22" in order for the submit button to be enabled OR "Field_A" value must equal "HTML block 22" AND "Field_B" value must equal "Field_C" for the submit button to be enabled I saw a topic on this question if a value is greater than 0, however nothing on how to change the 0 to a comparison between 2 fields. Thanks!
  5. I have a subscription form that is using a virtual radio button field (field: Virutal7) to force subscribers into choosing one of two versions. If the user clicks on the second option (Community Bank Version) I would like to update a hidden checkbox field (field: CBVer) with a check to track the version in our database. I am using the radio button so I can make the choice of a version a required field. I wrote the following JS to attempt to switch the checkbox when the user selects the second option, but to no avail. If anyone could take a look at this I would greatly appreciate it. Sample page: http://b2.caspio.com/dp.asp?AppKey=73be1000803de3ead2044f3ebe07 <SCRIPT LANGUAGE="JavaScript"> function addcbver() { if (document.getElementById('cbParamVirtual71').checked==true) { document.getElementById('InsertRecordCBVer').checked = true; } } document.getElementByID('cbParamVirtual7').onchange=addcbver; </SCRIPT> Regards, ET
  6. I need to be able to tell this code to display as a currency at times instead of just a value. This code is adding up a few different cells when the user changes cells. Can you let me know where in the code that should be added? Thanks so much! <div id="mypage"> </div> <SCRIPT LANGUAGE="JavaScript"> function calculate() { var Settle_ADV_Gross = isNaN((parseInt(document.getElementById("EditRecordSettle_ADV_Gross").value)))? 0 :(parseInt(document.getElementById("EditRecordSettle_ADV_Gross").value)); var Settle_DOS_Gross = isNaN((parseInt(document.getElementById("EditRecordSettle_DOS_Gross").value)))?0:(parseInt(document.getElementById("EditRecordSettle_DOS_Gross").value)); var Settle_Walk_Up_Gross = isNaN((parseInt(document.getElementById("EditRecordSettle_Walk_Up_Gross").value)))?0:(parseInt(document.getElementById("EditRecordSettle_Walk_Up_Gross").value)); var total= Settle_Walk_Up_Gross + Settle_DOS_Gross + Settle_ADV_Gross; document.getElementById("mypage").innerHTML=total; } document.getElementById("EditRecordSettle_Walk_Up_Gross").onchange=calculate; document.getElementById("EditRecordSettle_DOS_Gross").onchange=calculate; document.getElementById("EditRecordSettle_ADV_Gross").onchange=calculate; calculate(); </SCRIPT> </span></strong>
  7. Hello I am trying to perform two calculations and autosumbit the page, however only the second calculation is being performed when the page is autosubmitted. Please advise. <SCRIPT LANGUAGE="JavaScript"> function calculate() { var v_Current_Plan = parseFloat(document.getElementById("InsertRecordCurrent_Plan").value); var v_Current_Fee = parseFloat(document.getElementById("InsertRecordCurrent_Fee").value); var v_Rate= .08; var v_total = (((v_Current_Plan * v_Rate) + v_Current_Plan) - (((v_Current_Plan * v_Rate) + v_Current_Plan) * v_Current_Fee)); document.getElementById("InsertRecordCurrent_Plan").value = Math.round(v_total); } { var v_New_Plan = parseFloat(document.getElementById("InsertRecordNew_Plan").value); var v_New_Fee = parseFloat(document.getElementById("InsertRecordNew_Fee").value); var v_Rate= .08; var v_total = (((v_New_Plan * v_Rate) + v_New_Plan) - (((v_New_Plan * v_Rate) + v_New_Plan) * v_New_Fee)); document.getElementById("InsertRecordNew_Plan").value = Math.round(v_total); } /* On submitting the webform, the function calculate is executed */ document.getElementById("caspioform").onsubmit=calculate; </SCRIPT> <SCRIPT LANGUAGE="JavaScript"> function calculate() { var v_Current_Plan = parseFloat(document.getElementById("InsertRecordCurrent_Plan").value); var v_Current_Fee = parseFloat(document.getElementById("InsertRecordCurrent_Fee").value); var v_Rate= .08; var v_total = (((v_Current_Plan * v_Rate) + v_Current_Plan) - (((v_Current_Plan * v_Rate) + v_Current_Plan) * v_Current_Fee)); document.getElementById("InsertRecordCurrent_Plan").value = Math.round(v_total); } { var v_New_Plan = parseFloat(document.getElementById("InsertRecordNew_Plan").value); var v_New_Fee = parseFloat(document.getElementById("InsertRecordNew_Fee").value); var v_Rate= .08; var v_total = (((v_New_Plan * v_Rate) + v_New_Plan) - (((v_New_Plan * v_Rate) + v_New_Plan) * v_New_Fee)); document.getElementById("InsertRecordNew_Plan").value = Math.round(v_total); } /* On submitting the webform, the function calculate is executed */ document.getElementById("caspioform").onsubmit=calculate; </SCRIPT> <script> if(document.getElementById("caspioform")) { document.getElementById("caspioform").style.display = 'none'; setTimeout('document.forms["caspioform"].submit()',0); } </script>
  8. Hi there. Is it possible to condition the values of a radiobutton using Javascript? What I want to do is that, when the Data Page loads, checks if it meets a condition, and if it does, based on that is the value of the first option of my radiobutton. I haven't been able to make the first part work, and i want to make sure that works before adding the 'If' statement. Here's the code I'm currently using: <script> window.onload=function(){ document.getElementByname("InsertRecordVirtual1")[0].value="AAA"; } </script> I have also change it used "getElementById", and change the statement inside the parenthesis with "InsertRecordVirtual10", that last one based on what I found here: 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 Is it possible to do what I am trying to do with a Virtual Field? If it is, how can I make it work? I appreciate your help!
  9. I am trying to use an HTML block to insert script in a report to show a different hyperlink based on the condition of a field in the authorization....I tried to write and looking at it hopefully someone can help with what I am trying to accomplish: <script> if("[@field:PrioiritiesComplete^]" == "No") { window.location = "<a href="https://c0cmr504.caspio.com/dp.asp?AppKey=ExampleA?PersonID=[@authfield:PersonID#]&Email=[@authfield:Email]">Link To Complete</a> "; } else { ("[@authfield:EngagementSigned]" == "Yes") window.location = "<a href=" https://c0cmr504.caspio.com/dp.asp?AppKey=ExampleB?PersonID=[@authfield:PersonID#]&Email=[@authfield:Email]">Link To Review</a> "; } </script>
  10. Hello all, I have figured out how to use the page view increment in a details page, but I wanted to update a counter on submission and don't see a similar element for selection. Can this be done with a script? I'm not much of a programmer, and had tried the following: <SCRIPT LANGUAGE="JavaScript"> function count() { var i = parseFloat(document.getElementById("Count").value); i=i+1; document.getElementById("Count").value = i } document.getElementById("Countsubmission").onsubmit=calculate; </SCRIPT> Any help would be appreciated!
  11. I have a multi-select listbox thanks to this article. The only issue is I need these items separated by ";" instead of ",". Here is the code with the changes I have made: <script type="text/javascript"> var v_state = "[@field:Reason_for_Cancelltaion]" ; var o_state = document.getElementById("EditRecordReason_for_Cancelltaion") ; o_state.multiple = true ; function f_listbox() { if ( v_state.indexOf(";") > 0 ) { for (var i=0 ; i < o_state.options.length; i++ ) { if(o_state[i].value == v_state) { o_state.remove(i); break ; } } var o_st = v_state.split("; ") ; for (var j=0 ; j < o_st.length; j++) { for (var i=0 ; i < o_state.options.length; i++ ) { if(o_st[j]== o_state.options[i].value){ o_state.options[i].selected = true ; break ; } } } } } window.onload = f_listbox ; </script> Even though I have replaced the character it still separates by commas! Otherwise this functions as intended and I have even paired it with some jquery in order to remove the condition of holding down the control key for multiple selections. Any and all help is much appreciated!
  12. ababcock

    Time Sheet

    I have multiple submission forms that need to calculate total hours based on the begin time and end time entered. The script I have entered is: <script> document.getElementById('Submit').onmouseover = function(){ var date = document.getElementById('InsertRecordDate_of_Service').value; if(date == "") date = "1/1/2011"; var hour = document.getElementById('cbParamVirtual2').value; if(hour =="") hour="00"; var minute = document.getElementById('cbParamVirtual3').value; if(minute == "") minute = "00"; var ampm = document.getElementById('cbParamVirtual4').value; document.getElementById('InsertRecordStart_Time').value = date + " " + hour + ":" + minute + " " + ampm; var hour2 = document.getElementById('cbParamVirtual6').value; if(hour2 =="") hour2="00"; var minute2 = document.getElementById('cbParamVirtual8').value; if(minute2 == "") minute2 = "00"; var ampm2 = document.getElementById('cbParamVirtual7').value; document.getElementById('InsertRecordEnd_Time').value = date + " " + hour2 + ":" + minute2 + " " + ampm2; var start= new Date(document.getElementById('InsertRecordStart_Time').value); var end = new Date(document.getElementById('InsertRecordEnd_Time').value); var timeDiff = end - start; var hh = Math.floor(timeDiff / 1000 / 60 / 60); timeDiff -= hh * 1000 * 60 * 60; var mm = Math.floor(timeDiff / 1000 / 60); var totalmin= (mm+ (hh * 60)) ; document.getElementById('InsertRecordTotal_Units').value = totalmin.toFixed(2); }; </script> This is working some of the time, but not always, and I don't know what the problem is. I just submitted a record for 6/9/15 11:00 AM to 6/9/15 2:00 PM, and it came up with 185.00 hours. Does anyone know a way to make this work?
  13. Hello All, Does anyone have any tricks or scripts to prevent copy/paste and right click on a DataPage. I understand that most scripts may be browser dependent, but just looking to make it a bit more difficult for users to copy things. Thanks in advance
  14. I need to ensure that values in a column in a tabular report are between 0 and 100 (They are meant to be a percentage impact figure to be entered by the user). I studied the JS example of creating column totals in a tabular report (see http://forums.caspio.com/index.php/topic/3171-js-calculate-column-sum-in-the-result-page/ ) and modified the code as follows, but I cannot get the script to fire at all. I added a number of debugging statements to no avail. I have tried an "onsubmit" type of call as well, apart from the below example. Ideally there should be a way to fire this at the end of adding / editing each row, but I could live with at the end of the whole page as well. At the end of the Header: <div id="cb_checkImpact"> At the beginning of the Footer: </div> <script> function f_check() { alert('Inside function'); var v_impact = 0; var cas_form = document.getElementById("cb_checkImpact"); if (cas_form.getElementsByTagName("table").length > 0) { alert('Found records'); var cas_rows = cas_form.getElementsByTagName("table")[1].getElementsByTagName("tr"); for(var rowIndex=1; rowIndex < cas_rows.length; rowIndex++) { alert('Inside row loop'); var cells = cas_rows[rowIndex].getElementsByTagName("td"); /* 1 – change value inside brackets to choose column to perform validation */ v_impact = cells[2].innerHTML; alert('Found value:'); alert(v_impact); if ( parseFloat(v_impact) < 0 || parseFloat(v_impact) > 100){ alert('Value in %Impact field must be between 0 and 100'); return(false); } alert('No issues found'); } } alert('About to call function'); f_check(); alert('Finished function'); </script>
  15. Hello Caspio Ninjas! I've noticed when the page scrolls down the Hint Popup moves an equal distance down from the element producing the hint. When scrolled down more than a few lines the Hint popup moves all the way off the screen. I just tested it in a "preview" mode, and noticed that it only happens on embedded Data Pages. I removed all of my javascript for testing, and it didn't fix it. I even removed all markup except the script for a DataPage Where would i begin trying to diagnose this problem? What might be affecting the Caspio Hint popup from my page? Thanks
  16. I need to combine two (at times more, but once I can resolve for 2 I can easily extend) fields into a third field and commit the value back into the database, all the while working with fields in the results page of a tabular report. The example on the forum, ( http://forums.caspio.com/index.php/topic/3200-js-concatenatecombine-two-fields-into-one-field/ ) , is good but only for submission forms, and the comments on extending it also apply only to update forms or detailed pages of tabular reports. So basically it can't work within a given row in a table as it stands now. I have also checked out the example in ( ) but this one is about totalling a column across multiple rows, and it anyway doesn't commit the results to the database, whereas I need to combine multiple columns across the same row, AND commit to the database. Combining the learnings from the above two examples, I have tried as follows but it is not resulting in any value being inserted in the target field, and my suspicion is I need to do something different in the very last statement of the function. Please advise. 1. Added an HTML block at the top of the list of fields (so effectively the first column in the tabular report) containing: <div id="row_at_a_time"> 2. Added an HTML block at the end of the list of fields (so effectively the last column) containing: </div> <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var ProcessName = document.getElementById("row_at_a_time").getElementByTagName("Table")[1].getElementByTagName("tr")[1].getElementByTagName("td")[1].innerHTML; var ProjectID = document.getElementById("row_at_a_time").getElementByTagName("Table")[1].getElementByTagName("tr")[1].getElementByTagName("td")[6].innerHTML; var ChkUnique = ProjectName + ProjectID; document.getElementById("row_at_a_time").getElementByTagName("Table")[1].getElementByTagName("tr")[1].getElementByTagName("td")[6].innerHTML = ChkUnique; } document.getElementById("caspioform").onsubmit=concatenate; </script> Note that: - The first [1] in each of the statements is something I don't understand but have simply followed the example - what does it refer to? - The second [1] in in the place where the example uses "row_index" so it should help point to "current row" since we have declared each row of the tabular report as a single-row-table (I believe row indexes start at 1, and not 0, unlike column numbers?) - The last number in each of the statements ([1], [6] and [7]) points to the column numbers and means I am setting column [7] to be the concatenation of [1] and [6]. This will have to be customised for each use of this method in various tabular reports. However I think I am missing the equivalent of "insert record" aspect of the following statement and just setting the variable doesn't complete the job: document.getElementById("InsertRecordChkUnique").value = ChkUnique; And therefore this method is not working. Any thoughts? Incidentally I am using this method to enforce uniqueness across multiple columns, so for example column A and column B are individual not unique but column B needs to have unique entries for all records for a given value of column A. I am concatenating the two columns and forcing the value into a third column (hidden from users) which is set to "unique" so that the user is stopped from committing such records. If you know of a different way to achieve this which does not need the above solution, that too will solve my original problem anyway. And the key is to make this work in tabular reports, not just submission or update forms. And it needs to fire on insert as well as update. Many thanks!
  17. Hello Everyone! I have found some great answers on this forum for most of my issues but cannot find anything regarding this specific question I have. sincerely appreciate any offers of help. Currently I have a DataPage which outputs 5 text fields with a calender popup next to each (see attached img). I would like to select a date via the popup in the first field and have the subsequent fields all populate with the next day. So if you select 2/19/2015 then the output in the next data field is 2/19/2015 and so on. I believe that I can do this via some custom JS if I need to, but I wasn't sure if Caspio Bridge can help me do so automatically through a selection in the "Web Form Wizard- Configure Fields". I appreciate you checking out my post and any help you can offer! Cheers, Dilts
  18. Hi there, In the App I am currently developing I have a "View Inventory" DataPage where my users can see (for a chosen product) what the starting inventory was A, how many units are reserved / shipped B and finally how many units are available C. C is a calculated field where C = A - B On this page I also have an HTML block with a control button that my users can click to create a shipment request, but I want this to be disabled when C = 0 because as it stands right now, there is nothing stopping them from ordering an item that is out of stock. The current code for my button is as follows: '<div style="margin: 10px;"><a href="http://eu1.caspio.com/dp.asp?AppKey=cde830001d57b1a237854adab459&Stock_ID=[@field:Stock_ID]&Product_Description=[@field:Product_Description]" style="background: rgb(61, 130, 171); padding: 7px 20px; border: 1px solid rgb(221, 221, 221); border-image: none; color: rgb(255, 255, 255); font-weight: bold; text-decoration: none; white-space: nowrap;">Create Shipment Request</a></div>' I read on another post on here that the way to address this was to use Javascript, so following that advice I changed the code for my button the the following: <script type="text/javascript"> var cb_boolean = '[@calcfield:1]'; if (cb_boolean != '0') { document.write("<input type='button' value='Create Shipment Request' Name='mybutton' onclick='myfunction()'> "); } else { document.write("<input type='button' value='Out Of Stock!' Name='mybutton' disabled=true>"); } function myfunction() { window.location.href='http://eu1.caspio.com/dp.asp?AppKey=cde830001d57b1a237854adab459&Stock_ID=[@field:Stock_ID]&Product_Description=[@field:Product_Description]'; } </script> This worked in terms of disabling my button where C = 0, but then the parameters were no longer being passed to my shipment request DataPage. I suspect this is a syntax error of some sort, but being a newbie to the worlds of both HTML and Javascript I just don't know what I need to change. Any advice would be much appreciated Thanks
  19. Hi All, Can anyone please provide a JavaScript to do the following as I have tried rules and I can’t seem to get it to work. I have a record in a data page that contains fields d1 to d10 (these are date fields) and fields et1 to et10 (hidden fields). If an authenticated user amends d1 then I want his/her username to be stored in et1. If an authenticated user amends d2 then I want his/her username to be stored in et2. If an authenticated user amends d3 then I want his/her username to be stored in et3. If an authenticated user amends d4 then I want his/her username to be stored in et4. If an authenticated user amends d5 then I want his/her username to be stored in et5. If an authenticated user amends d6 then I want his/her username to be stored in et6. If an authenticated user amends d7 then I want his/her username to be stored in et7. If an authenticated user amends d8 then I want his/her username to be stored in et8. If an authenticated user amends d9 then I want his/her username to be stored in et9. If an authenticated user amends d10 then I want his/her username to be stored in et10. Regards Pearse
  20. Hello all, I am currently working on a search form (using a virtual field submission form) that has a dropdown menu to select from predefined reports. The way I would like this to function is that when the user selects an option (such as "Recent (Within the Last 10 Days)") an onchange function would change the search fields to the input needed to produce those results. I am fairly new to JavaScript, here is what I have been able to get: <SCRIPT LANGUAGE="JavaScript"> function ocPredefinedReports() { if (document.getElementById("cbParamVirtual8").value=='Recent (Within the last 10 days)') { document.getElementById("cbParamVirtual5").value= 'Doe'; } } document.getElementById("cbParamVirtual8").onchange=ocPredefinedReports;</script>​ Through Google-Fu I was able to get a function working at one point that gave me ten days ago (Unfortunately I didn't save it anywhere!) but it was in the wrong format entirely. Any and all help is much appreciated, thank you. -Blue Edit: Sorry about the terrible title, time for more coffee.
  21. Good afternoon, I am attempting to use the Javascript posted in the solutions to combine fields. In my case I have three fields I am looking to combine. Employee_First_Name, Employee_Last_Name, and Employee_ID. The ideal formatting of this would be Lastname, Firstname - EmployeeID (For Example Smith, John - 111111) Here is the script I have that is not currently combining the fields let alone getting into the details of formatting. This is being deployed in a submission datapage. <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var Employee_First_Name = document.getElementById("InsertRecordEmployee_First_Name").value; var Employee_Last_Name = document.getElementById("InsertRecordEmployee_Last_Name").value; var Employee_ID = document.getElementById("InsertRecordEmployee_ID").value; var Employee_Selector = Employee_Last_Name + Employee_First_Name + Employee_ID; document.getElementById("InsertRecordEmployee_Selector").value = Employee_Selector; } document.getElementById("caspioform").onsubmit=concatenate; </SCRIPT> Thank you for your time!
  22. Hi, I have some script in the table that I need to be able to run on my DataPage. Can I do that? Thanks.
  23. Hi, I'm new to Caspio. I have a 9 date text fields with calendar picker. When user picks date for 1st field I need the subsequent 8 fields to populate with the 1st field's date + 1 business day. The result would be as follows: field 1 - 01/16/2015 SELECTED field 2 - 01/19/2015 AUTOPOPULATED field 3 - 01/20/2015 AUTOPOPULATED field 4 - 01/21/2015 AUTOPOPULATED field 5 - 01/22/2015 AUTOPOPULATED field 6 - 01/23/2015 AUTOPOPULATED field 7 - 01/26/2015 AUTOPOPULATED field 8 - 01/27/2015 AUTOPOPULATED field 9 - 01/28/2015 AUTOPOPULATED THEN SUBMIT* Any help, javascript and/or implementation would be greatly appreciated. Thanks.
  24. Hi, I have a form with 3 checkboxes. A visitor can select any checkbox to get the products they want: newspaper or magazine, both, or just one. --- The visitor can also select to get the e-newsletter, but only if the newspaper checkbox is selected. Else the e-newsletter checkbox is disabled (which is a rule set configured in the form that works fine). What I need.. is a function for if someone chooses both "newspaper" and "e-newsletter" checkboxes then decides that they don't want "newspaper" and deselect it (which leaves e-newsletter still checked). I need an onchange function that unchecks the "e-newsletter" checkbox at the exact same time newspaper is unchecked. Note - The exisitng rule makes the checkbox disabled and enabled, but it doesn't uncheck it. SAMPLE OF FORM: 1) [ ] Get this free newspaper /--> OC_news_print = id 1b) [ ] Get the e-newsletter too /--> OC_news_eletter = id 2) [ ] Get this different magazine -- SOMETHING LIKE CODE BELOW IS NEEDED - MINE / IT DOESN'T WORK --- <! -- vars NEEDED AT ALL ? var ocPrint = document.getElementById("InsertRecordOC_news_print"); var ocEnews = document.getElementById("InsertRecordOC_news_eletter"); --> function ocProductsCheck() { if (document.getElementById('InsertRecordOC_news_print').checked.length<1) { document.getElementById("InsertRecordOC_news_eletter").checked=false; } else { if (document.getElementById('InsertRecordOC_news_print').checked.length>0) { document.getElementById("InsertRecordOC_news_eletter").checked=false; } } document.getElementById("InsertRecordOC_news_print").onchange=ocProductsCheck; Thanks - Geoff
  25. I have a Single Record Update form where once a user has submitted data on Record #123, I want any other users subsequently trying to update Record #123 to be "locked out" from submitting via that form. In other words, I need to be able to disable a form after it's been used once, or when Some_Field = Whatever. You could just disable it with Rules, but if 2 people arrive on the form before either has submitted, then the 2nd User rewrites over the 1st User's data. I need to prevent that from happening. Caspio Support recommends: In order to prevent the next users to submit/edit the same record, the "timestamp check" should be done upon form submission. A solution would be to write a JavaScript function to perform the "timestamp check" and then call the function on the form submission event. Can anyone please assist with this? I'm JavaScript illiterate. Thanks!
×
×
  • Create New...