Jump to content

aaronfreed

Members
  • Posts

    21
  • Joined

  • Last visited

  • Days Won

    1

aaronfreed last won the day on December 1

aaronfreed had the most liked content!

aaronfreed's Achievements

  1. it appears that the javascript console being open was the issue: first attached screenshot: input field with console closed second attached screenshot: input with console open and i was testing with the console opened, which inexplicably (at least to me) caused things to break. so, good to go! thank you @TellMeWhy
  2. hi @TellMeWhy. no joy. using a direct paste of your code (having duly replaced FIELDNAME), the validation doesn't work; every time i try to input something, i get the alert message. it is as if the 'input' event is a little trigger happy and doesn't give me the chance to input anything. i have confirmed that there are no uncaught javascript errors on the page using the console, so at least we know the code is syntactically good. and ideas? here is the code again: <script> //set input default to one document.addEventListener("DataPageReady", function fx(){ var el = document.getElementById('InlineAddquantity'); el.setAttribute("type","number"); el.value = '1'; //el.setAttribute("min","1"); //el.setAttribute("max","5"); //check for value in range...alert and reset if not document.addEventListener("input", function tx(){ var field1=document.getElementById('InlineAddquantity'); if(field1.value < 1 || field1.value > 5){ alert("Field cannot be less than 1 or greater than 5"); field1.value = '1'; }; if(isNaN(field1.value)== true){ alert("Field should be a number"); field1.value ='1'; } }); }) </script>
  3. whelp @TellMeWhy, i'm stumped. first, what works: <script> document.addEventListener("DataPageReady", function fx(){ // Upon Load set value of FIELDNAME to 1 document.getElementById('InlineAddFIELDNAME').value ='1'; </script> since caspio only gives us a text field to input numbers, i used the same method to change the input type: <script> document.addEventListener("DataPageReady", function fx(){ // Upon Load set value of FIELDNAME to 1 var el = document.getElementById('InlineAddFIELDNAME'); el.setAttribute("type","number"); el.value = 1; </script> and that works like a champ. before trying your eventListener approach to validating the input, i tried setting "min" and "max" attributes using the metheod above, but that didn't work; i didn't get any HTML5 messages saying the input was out of limits. and i couldn't get it to work either (i opted for the 'alert' version): <script> document.addEventListener("input", function tx(){ var field1=Number(document.getElementById('InlineAddFIELDDNAME').value); if(field1 < 1 || field1 > 5){ alert("Field cannot be less than 1 or greater than 5"); field1.value = '1'; </script> acknowledging that the code changes slightly if i've redefined the input type as a number, i still couldn't get this to work. the 'input' event doesn't let me change anything; i am simply stuck with the default '1' and any attempt to change it results in an alert and reset to '1'. so, my question now is: what other events might i use (and might you direct me to a resource showing me the types of events available on a caspio form, inline or otherwise)? or maybe this is a validation that can only occur upon clicking the 'add' button?
  4. @TellMeWhy oooff. i don't want to go there, either. but wow...thanks for making that effort. i'll give it a try. perhaps after a nap. or a shot of rum. i'll report back for posterity's sake. again, thanks!
  5. thanks, @TellMeWhy. i'll give it a shot. regrettably, i failed to mention that i need this to work for inline adds and inline edits in a tabular report, which complicates matters. do you or anyone else have thoughts only validating inputs on what would be multiple fields of the same class in different rows of the table? it's particularly a challenge since other fields in each row share the same class.
  6. i have a table with an integer field called 'quantity'. in the form submission datapage for that table, i have a 'text field' form element to allow the user to specify the quantity. i need to do three things: 1. set a default of 1 2. set a minimum value of 1 3. set a maximum value. the maximum value may be fixed (e.g. '5') or it may have to be a calculated value (e.g. SELECT SUM(someField) FROM tbl.some_other_table WHERE....) can you help? gracias!
  7. thank you, @TellMeWhy. that worked like a champ. and thank you, @CoopperBackpacki got the jquery version to work, but i like your / direct native approach and will likely use it elsewhere.
  8. @NiceDuck interesting tidbit (at least to me): one cannot call a virtual field with a calculated value to the header. one CAN, however, pull a calculated field to the header.
  9. i have a flow of registration forms with an 'exit' url on each page, which allows the users to exit before the full registration is complete. before following the click URL, i want an 'are you sure' confirmation message to be displayed to the user. if 'yes' then the click URL would be loaded; if 'no' then nothing would happen. i have the following html/jquery code in the footer of forms that are part of the registration process: <a class="exits" href="https://c1dcs255.caspio.com/dp/0db19000a392125dc37d41b6a8ab">exit</a> <script type="text/javascript"> $('.exits').on('click', function () { return confirm('Are you sure? Your order will not be registered.'); }); </script> straightforward as this seems, i can't get it work. i never get a confirmation popup.
  10. changes to authentication field values do not update until the session is ended and then re-started.
  11. the answer is this: in rules for datapages based on virtual calculated field queries of Yes/No variables, the values are Y and N.
  12. @Nuke354 i opened a ticket on this one. support figured it out: the values are Y and N. i told them that the handling of Yes/No variables was inconsistent in caspio (e.g. triggers use true/false) and that perhaps an audit was in order.
  13. thank you, @kpcollier that sounds like a far more efficient approach than what tech support just gave me, which was to go to each field in the view and manually un-include it and then re-include it. i told them i hoped they didn't consider that to be resolution, but rather only a temp workaround. i appreciate your taking the time to help me out.
  14. i have changed / added / renamed fields in some tables. i have checked the views which use those tables, and have ensured that the changes are reflected in the view (e.g. ensured that 'include all fields' is checked). however, whenever i use a VIEW for a datapage, the 'datasource' fields that are available for record-level security or for lookup tables in dropdown elements show only the old fields and the old field names. the only way to see the correct fields is to use the table as the datasource, but of course that shouldn't be the case. all this is to say, it seems that dropdowns in datapages for lookup tables and record -level security are using cached versions of the original view/table. a screenshot is tough to pull off, but perhaps this example will help: current table fields: field ABC (originally named field AB) field XYZ (not originally in table or view) current view fields (match table, as expected): field ABC field XYZ fields available for dropdowns and record-level security in datapages (does not match table; unexpected behavior): field AB (not field ABC, and not field XYZ)
  15. i figured it out. i was changing the value of a field that was used in the active authentication. that is, it appears that authentication fields do not update unless/until you logout and then re-login. thus, i was getting null values because the field value was null at the time i logged in. i think this is something that needs be addressed. thoughts?
×
×
  • Create New...