Search the Community
Showing results for tags 'selector'.
-
I found that I can hide table elements based on HTML5 data attribute values. This solves a shortcoming of Caspio datapage configuration options: If you have a datapage that uses Inline Insert, you will find that you must choose between allowing a field to be editable on Insert, and allowing a field to be editable on Edit. In my case, I wanted to allow Inserts with a date, but once the record was there, I didn't want the date to ever change. When you enable Inline Insert, you don't have this ability, because if you disable editing the date, then one can't Insert new records with a date. However, a unique HTML5 data attribute=name, value=InlineEdityourFieldName is only applied to rows opened for editing, not on the Insert row, so we can use the attribute and value combo as a css selector to target Edits and not Inserts. Here I add the class "hideDateEdit" to matches for my selector, then inline a style to hide that class. Actually, I'm adding the class to the parentNode of my match, so that the contents of the whole cell are hidden, in this case, the date's text input, as well as the adjacent calendar img for the popup calendar function. <SCRIPT LANGUAGE="JavaScript"> var elems = document.querySelectorAll('input[name=InlineEditDates_Date]'); for (var i=0, m=elems.length; i<m; i++) { elems.parentNode.className = "hideDateEdit"; } </SCRIPT> <style type="text/css">.hideDateEdit { display: none; } </style>
-
I can't figure out a javascript to disable this checkbox, to the left of the Yes group. The script must check for Yes, because sometimes only the (blank) group exists, and sometimes only (blank) and Yes, and sometimes (blank) No and Yes. Can't use CSS as far as I can tell. The goal is to prevent the mass-selection of Yes records. I tried using some javascript browser addons to find an appropriate selector, but was my first time using and no luck. I also tried using .prev() in jQuery, but now I don't think the checkbox is a sibling. I tried modifying the code used to conditionally format rows, but those are inserted into HTML blocks for records, and so can't operate on Group rows. Thanks in advance!
- 7 replies
-
- checkbox
- javascript
-
(and 2 more)
Tagged with: