Jump to content

BethShaffer

Members
  • Posts

    15
  • Joined

  • Last visited

  • Days Won

    3

BethShaffer last won the day on January 23 2020

BethShaffer had the most liked content!

BethShaffer's Achievements

Newbie

Newbie (1/14)

3

Reputation

  1. We have a database of meetings where each meeting selects the days of the week they meet via a multiselect dropdown. The choices are: Every Day Sunday Monday Tuesday Wednesday Thursday Friday Saturday Contact for Day The problem is that when a visitor searches meetings, if they select Monday for instance, only meetings that contain Monday appear. Those marked Every Day should also appear in the search results, but because of the static nature of these dropdowns, it doesn't work that way. I need some kind of script that tells Caspio to include results for Every day on a search for any day of the week. I tried adding all the days, comma separated, to the Value field in my Days table, but that gets me nowhere. If I try to include the Value field in the search, it breaks the whole page and no results appear at all. Is this even possible or is it yet another limitation of Caspio?
  2. Ha! I got this working. I missed the step of having to name the ID for the No Results Message in Localizations. If someone else needs to change the header message when no results are found, this is how. I found some clues using this online help page, https://howto.caspio.com/integration/map-mashup/hiding-the-map-when-no-results-are-found/ Go to Localizations and choose the language you're using, and go to #351 No Records Found. Add a custom message if there isn't already one, and put a div tag around it with an ID, mine is "norecord" for this example. Then add another div tag around the header content you want to change and also give it an ID, ID="HOW" for this example. Then add this code to the footer of your Configure Results Page Fields: Match whatever names you give the respective fields to the IDs in the code below. <script type="text/javascript"> if (document.getElementById("norecord")) { document.getElementById("HOW").innerHTML = "THE NEW CONTENT YOU WANT DISPLAYED WHEN THERE ARE NO RECORDS"; } </script> This new content will overwrite whatever content is in the <div> named HOW when the search returns no results. If you're adding HTML to the new content, you need to escape all your quotes or it won't work. I made that mistake. In a link example, it would be: <a href=\"http://mywebsite.com\">Visit my website!</a>
  3. I've also tried giving the <div> an ID and then replacing its contents if there are no search results. <script type="text/javascript"> if (document.getElementById("norecord")) { document.getElementById("HOW").innerHTML = "Message to be Displayed if No Search Results"; } </script> <div id="HOW">Normal Message Displayed on the Page</div>
  4. Here is my attempt, which of course, does not work. <script type="text/javascript"> if (document.getElementById("norecord")) { document.getElementById("message").innerHTML = "ONE MESSAGE"; } else { document.getElementById("message").innerHTML = "DIFFERENT MESSAGE"; } </script>
  5. Good morning, My search page has a header that displays information on how to use the page. When the search returns no results, that information is not needed and I want to display a different message on what they can do next. I know there is a place in my Style for a "no results found" message, but this does not remove the unneeded information in my header, it just displays new text below it and it makes the page too long. I need the code for displaying two different messages in the header of my page; one when search results are returned, and another when they are null. I know the basic if statement when it's for fields, but I don't know the correct syntax when it's for search results. Help is appreciated.
  6. I also wanted a script to clear the automatic password, but on reading this post, basically my users HAVE TO enter or change their password every time they update a record or a random password will be entered in its place? That would be a nightmare. What if I just remove the password field from the edit form altogether? Will the original password be left intact?
  7. THANK YOU!!! That was the issue! Works great on all pages now. I would have played with this for hours.
  8. I just figured out the easiest way to send an email, conditional on a radio button, and it works great in my details page. No Javascript, just a Virtual field. My use case for this is that for some edits on my details page, such as fixing a typo, I don't need to send a confirmation email to the originator of the record. But for requested changes, such as a new location or phone number, I do need to send the confirmation email. Each one of my records has a Confirmation_Email field that I needed to send to. On Configure Details Page Fields, Create a Virtual field, we'll call it Virtual1. Set Form Element to Radio Buttons Source: Custom Values If you want a "Don't Send" choice, In the first value set, type something like "No Email" in the Display field. I set this one to Default. (You should enter an email address for the value. It should be a real address, like a catch-all so your emails don't get flagged for spam.) You can create any number of subsequent bullet choices and, for instance, enter a person's name or department for the Display, and their email address for the value. Set whatever one you wish to the default. If the email address you need to send to is contained in a field, like mine was, then go to advanced and set it to receive a value on load. Set it to Data Source Field and select your email field for both Value and Text to Display. Lastly under Destination and Emails, set your Acknowledgement Email to Virtual1. Result: on your details form, you will see a radio button for each choice you created and you can decide if, or who you want to email.
  9. I just found the easiest way to send an email, conditional on a radio button, and it works great in my details page. No Javascript, just a Virtual field. My use case is that for some edits such as fixing a typo, I don't need to send a confirmation email to the originator of the record. But for requested changes, such as a new location or phone number, I do need to send the confirmation email. Each one of my records has a Confirmation_Email field that I needed to send to. On Configure Details Page Fields, Create a Virtual field, we'll call it Virtual1. Set Form Element to Radio Buttons Source: Custom Values If you want a "Don't Send" choice, Make a Value and type something like "No Email" in the Display field. I set this one to Default. (You should enter an email address for the value. It should be a real address, like a catch-all so your emails don't get flagged for spam.) You can create any number of bullet choices and, for instance, enter a person's name or department for the Display, and their email address for the value. Set whatever one you wish to the default. If the email address you need to send to is contained in a field, like mine was, then go to advanced and set it to receive a value on load. Set it to Data Source Field and select your field for both Value and Text to Display. Lastly under Destination and Emails, set your Acknowledgement Email to Virtual1. On your details form, you will see a radio button for each choice you made and you can decide if, or who you want to email.
  10. The solution I would like to get working is this (from above): <SCRIPT LANGUAGE="JavaScript"> function create_list() { var emailsList = "myfirstEmail@mydomain.com"; if(document.getElementById("cbParamVirtual2").checked) emailsList = emailsList + ";"+document.getElementById("cbParamVirtual2").value; document.getElementById("cbParamVirtual1").value = emailsList; } document.getElementById("caspioform").onsubmit=create_list; </SCRIPT> Then you are supposed to set your Acknowledgement Email to Virtual 1 and make Virtual 2 a checkbox. I want Virtual 2 to receive the parameter of the Confirmation Email field, which has the addresses I want to send to when the check box is checked. I have tried setting this up, but I can't get it working. I'd rather not make several extra Datapages just to send emails. Thanks
  11. Hi, I'm hoping to get some help with my Javascript code, though I don't know that it is broken. This works perfectly on page one of the Search Results, but on results with more than one page, when I go to the next page, none of the formatting or text generated by the script shows at all. <script type="text/javascript"> var cb_boolean = '[@field:GroupIntergroup]'; if (cb_boolean == 'Group') {document.write('<span style="color: green;">[@field:Meeting_Days]</span> [@field:City]');} else {document.write('<span style="color: #ff8c00;">Multiple Groups</span>');} </script> What am I doing wrong?
  12. Can you explain the simpler way mentioned by the OP, "I know how to do the one checkbox and autosubmit thing, where an email is only sent if a checkbox is selected". I can't find anywhere how to do it. I have a Confirmation Email field which is the email address for each record. When the check box is selected, I need the email to be sent to the address in that field. Thanks
  13. I really need this functionality. Can someone help make this work?
  14. Hello, I have a registration form for Chapters of our organization that can represent more than one state, or even country. I use a script that dynamically shows listboxes for state or province depending on whether the US or Canada is selected. They both post to the same field, and so Virtual Fields are utilized. This all works fine, but I need those Virtual Fields to be Multi-Select. I do utilize the suggested script already, and I can get the Multi-Select to work on the form. The problem is that even though my two Virtual Fields are Multi-Select, only one selection makes it to the table. What is wrong with my script? Country WORKS, it is not a Virtual Field, as does Languages_Spoken. Virtual 2 and Virtual 3 WILL Multi-Select, but ONE selection makes it into the table. I hope this explains clearly. Form is at https://c3gaf515.caspio.com/dp.asp?AppKey=54ce4000db281c70d086433eb0fc Thanks <SCRIPT LANGUAGE="JavaScript"> /* "fieldName" is the variable name for the listbox type form element field. */ var fieldName = "InsertRecordLanguages_Spoken"; var x=document.getElementsByName(fieldName); x[0].multiple=true; /* "fieldName2" is the variable name for the listbox type form element field. */ var fieldName2 = "InsertRecordCountry"; var x=document.getElementsByName(fieldName2); x[0].multiple=true; /* "fieldName3" is the variable name for the listbox type form element field. */ var fieldName3 = "cbParamVirtual2"; var x=document.getElementsByName(fieldName3); x[0].multiple=true; /* "fieldName4" is the variable name for the listbox type form element field. */ var fieldName4 = "cbParamVirtual3"; var x=document.getElementsByName(fieldName4); x[0].multiple=true; </SCRIPT>
  15. This question still hasn't really been answered. I know how to sort in my FORM, but there is no way to sort in the RESULTS by day, not alphabetically. I don't want every day of the week to have a number in front of it, that just looks stupid. Why can't I sort my results the same way I can my dropdown on my form? I should be able to sort by value and have the display show on the results in the order I want. There is no way to do this. Then the suggestion about the corresponding field full of numbers. That is fine, but is there a script to make that field auto-populate when each day is selected? Surely other people need to sort by day of the week, this shouldn't be this hard.
×
×
  • Create New...