Caspio Ninja
  • Content count

  • Joined

  • Last visited

  1. Hi, I am using a script in an html block to detect certain criteria and display something based on that criteria. Here is my script: <script> var status = "[@field:Account_status]"; function invitepopup() {"[@field:User_ID]", "Invite", "menubar=1,resizable=1,width=500,height=500"); } if (status === "Yes") { document.write("Active"); } else { document.write('<a href="#" onclick="invitepopup()" title="Click to invite again">Invited by [@field:OriginUserName]</a>'); } </script> The if/else works fine, it shows "Active" for all the active users and "Click to invite again" for all the invitees ... however the link doesn't send the parameter properly.[@field:User_ID] is passed with the wrong User_ID. It seems to be passing the ID of the last user in the table, rather than the ID of the row it is in - it's currently showing 3 invitees in my table and they all are being received by the popup with the same ID (last user in the table). However if I just put this in as a plain (<a href="[@field:User_ID]" title="Click to invite again">Invited by [@field:OriginUserName]</a>), it works completely fine! Is there something in the script which is removing or replacing the User ID? I'm completely stumped! Hope someone can help! Many thanks Nikki
  2. Hi there, Thanks for this, I didn't explain properly ... these aren't separate groups, it's one field, grouped by what's in the field! So my field is "status" and it is grouped by one of 3 items in this field: open, pending, archive. I would like "open" to be expanded, but pending and archive to be collapsed. Many thanks! Nikki
  3. Hi there, I have a tabular report datapage which uses a collapsible group. It seems you can either have all expanded by default or all collapsed by default and nothing in between. Is there a workaround to this, so that I can choose to only have one of my 3 groups open and the other 2 closed? Many thanks Nikki
  4. Multiple values separated by commas input

    Thank you so much @nightowl! I've been going round and round in circles on this for a couple of weeks, and definitely need some help! Fingers crossed
  5. Multiple values separated by commas input

    Hi @nightowl, I am facing a similar issue, but slightly different and I can't quite seem to tailor your solution to fit. I was wondering if you could give me some pointers? OK, so I have a Submission form datapage, the datasource is my table [DataSources]. I have 2 fields that need to be updated, [Datasource] and [Project]. I'd like to potentially create up to 30 new records, each with a value in the [Datasource] column and the [Project] column. I want to be able to select items graphically, so I have a table of 30 logos, and when I click on any of these, I want them to be "selected". The Project name will always be the same, but there could be up to 30 Datasources if they select all the logos. At present, I have used an html block to display all of my logos and javascript to pass them all to the relevant field. I'll show you the first 5: <a href="#" onClick="SelAdobe()"><img src="" id="Adobe" class="MAIN"></a> <a href="#" onClick="SelBARB()"><img src="" id="BARB" class="MAIN"></a> <a href="#" onClick="SelBBCweather()"><img src="" id="BBCweather" class="MAIN"></a> <a href="#" onClick="SelBloomberg()"><img src="" id="Bloomberg" class="MAIN"></a> <a href="#" onClick="SelBrandwatch()"><img src="" id="Brandwatch" class="MAIN"></a> <script> function SelAdobe() { document.getElementById("Adobe").className = "SELECTED"; document.getElementById("InsertRecordDatasource").value += "Adobe,"; document.getElementById("InsertRecordProject").value += "[@authfield:User_info_Project],"; document.getElementById("InsertRecordDatasource").multiple = true; } function SelBARB() { document.getElementById("BARB").className = "SELECTED"; document.getElementById("InsertRecordDatasource").value += "BARB,"; document.getElementById("InsertRecordProject").value += "[@authfield:User_info_Project],"; document.getElementById("InsertRecordDatasource").multiple = true; } function SelBBCweather() { document.getElementById("BBCweather").className = "SELECTED"; document.getElementById("InsertRecordDatasource").value += "BBC Weather,"; document.getElementById("InsertRecordProject").value += "[@authfield:User_info_Project],"; } function SelBloomberg() { document.getElementById("Bloomberg").className = "SELECTED"; document.getElementById("InsertRecordDatasource").value += "Bloomberg,"; document.getElementById("InsertRecordProject").value += "[@authfield:User_info_Project],"; } function SelBrandwatch() { document.getElementById("Brandwatch").className = "SELECTED"; document.getElementById("InsertRecordDatasource").value += "Brandwatch,"; document.getElementById("InsertRecordProject").value += "[@authfield:User_info_Project],"; } </script> This is all working, in that it updates my table with the selections ... but all on one line. So if we clicked on all the above, it would insert only 1 record like this: Project column: Project1,Project1,Project1,Project1,Project1, Datasource column: Adobe,BARB,BBC Weather,Bloomberg,Brandwatch, Whereas I'd want it to insert 5 separate records. Is this something you can help me with? Many thanks! Nikki
  6. Hi there, I've built a page that has a grid of images, allowing users to click on these images to make a selection ... and then I want these selections to all be saved to a table as separate entries along with their user information. So far, I can get only 1 selection to pass to the table. If they click on one of the images, that is sent to the table, fine. I've set it up so that each selection is added to the string, separated by a comma, but then this passes to the table as a single entry with the comma separated string. This is my code: function SelDatasource1() { document.getElementById("Datasource1").className = "SELECTED"; document.getElementById("InsertRecordDatasource").value += "Datasource1,"; document.getElementById("InsertRecordProject").value += "[@authfield:User_info_Project],"; document.getElementById("InsertRecordDatasource").multiple = true; } function SelDatasource2() { document.getElementById("Datasource2").className = "SELECTED"; document.getElementById("InsertRecordDatasource").value += "Datasource2,"; document.getElementById("InsertRecordProject").value += "[@authfield:User_info_Project],"; document.getElementById("InsertRecordDatasource").multiple = true; } ...etc etc ... there are over 30 of these. If somebody selects Datasource1, Datasource5, Datasource12, it shows up in the table like this: PROJECT DATASOURCE Project1,Project1,Project1 Datasource1,Datasource5,Datasource12 I am using a Submission form datapage at present, and have added my code using html blocks and footer. 2 things I need help on: 1. I know there is a better way to add a comma to the string, other than putting it in like this (i.e. value +="Datasource1,"). This way, a comma is added for a single entry and at the end of a long string, which I don't want to do - can anybody help me with this? 2. Can I pass this comma separated string so that it shows up in my table like this: PROJECT DATASOURCE Project1 Datasource1 Project1 Datasource5 Project1 Datasource12 Any help would be greatly appreciated! Many thanks Nikki
  7. Hi, I'm stuck on an issue and I'm hoping somebody will be able to help! What I have so far: a table named "Datasources" with a single line for each entry with 2 fields - project and datasource Each Project can have multiple datasources, so some projects may have 20 entries or some may have only 2 or 3, so the table looks like this: PROJECT DATASOURCE [ProjectA] [Datasource1] [ProjectA] [Datasource2] [ProjectA] [Datasource3] [ProjectB] [Datasource1] [ProjectB] [Datasource5] [ProjectB] [Datasource8] etc etc What I need to do: I would then like to set up a datapage, which is like a shop of sorts. It will display 20 different images relating to a library of items available for selection. These would be Datasources 1-20. I would like this page to display all of these logos, but show visually somehow if they have already been selected by that particular project in the Datasources table. So in the example above, when somebody from ProjectB views the table, they will see all 20 datasources, but only Datasource 1, 5 and 8 will be ticked. They then need to be able to select new ones should they wish. So they can click on the logos for Datasource 6, 9 and 10, and when they click the update button those 3 new entries will be passed to the Datasources table. When they refresh the page, Datasources 1,5,6,8,9,10 are all ticked. The issues I have are: How can I get the datapage to search every item in the table and show a different image (i.e. one with a tick overlayed) if that particular project has already selected that datasource? i.e. search table, IF project = ProjectA and Datasource = Datasource2 anywhere in the table, display image "datasource2-ticked". I don't want it to just search one line of the table, but the whole table. How can I get the page of logos to update multiple lines in the same table? i.e. Datasource1 image = "datasource1-grey" UNLESS it has already been selected, in which case image = "datasource1-ticked". Onclick image becomes "datasource1-colour" AND a new record is created with @Project in project column and Datasource1 in @Datasource column. And at the same time this can be done if multiple logos are selected, a new record is created for each one. Help! Many thanks Nikki
  8. Thanks for your reply! However this doesn't work. It's creating a text area and hiding the text field, which is fine, but my original dropdown isn't displaying, so the text area is empty. Any ideas? To clarify: My Datapage reads from the table "Cards" My dropdown is Virtual15 and reads from table "DataSources" (parent field in js) My cascading text field is Virtual16 and uses Virtual15 as parent field (virtual field in js) The text area I've created as part of the instructions is Virtual17 (text area in js) Hope you can help! Many thanks Nikki
  9. Hi there, Ideally I want to use a cascading text area, but apparently only a text field is available as a cascading element. I am using a virtual field and dropdown from lookup table to find the field I want in a table, and then I want to display a full text area from that table on my page (and possibly an image from that table too). Is this doable using javascript? I don't know how to access the correct table as my datapage is obviously linked to the wrong table. Many thanks Nikki
  10. OK, now got this after a bit more research, but still not working!!! Pleeease, anyone?? <script> var dropdown = document.getElementById("EditRecordExpected_Outcome"); var selectedValue = dropdown.options[dropdown.selectedIndex].text; if (selectedValue === "Business Insight") { document.getElementById("result").style.backgroundColor = "black"; } </script>
  11. I'm trying this but no good: <select id="EditRecordExpected_Outcome"> <option value="1">1</option> <option value="Business Insight">Business Insight</option> <option value="3">3</option> <option value="4">4</option> </select> <script> var dropdown = document.getElementById("EditRecordExpected_Outcome"); if (dropdown.value === "Business Insight") { document.getElementById("result").style.backgroundColor = "black"; } </script> <li><a data-toggle="tab" href="#menu4" id="result" style="background-color: #10368F; color: white;">5. TEST RESULT</a></li>
  12. Hi there, I have tabbed content on my page. One of which looks like this: <li><a data-toggle="tab" href="#menu4" style="background-color: #10368F; color: white;">5. TEST RESULT</a></li> I'd like to change the background color of this element to grey IF my dropdown (named [@Expected_Outcome]) equals Business Insight. I know I can probably figure this out, but my brain is turning to mush from looking at this and I have a deadline looming!! Can anyone help me write the correct script? Many thanks Nikki
  13. Hi, So I'd like a user to be able to enter a bunch of words, comma separated, in a submission form. And then another user to be able to select from that list in dropdown format in a report datapage. Any ideas? I'm stumped! Many thanks Nikki
  14. Hi there, Just wondering if anyone knows whether it's possible to drag items in a table to reorder them in Caspio datapages? I have a report datapage of a list of projects, and wish to be able to reposition each entry based on priority. Any thoughts? Many thanks Nikki