<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Snipplr</title>
    <description>Recent snippets posted on Snipplr.com</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Tue, 09 Jun 2026 11:30:11 +0000</lastBuildDate>
    <item>
      <title>(JavaScript) SALSA Template Script to generate dynamic titles - powerthru</title>
      <link>https://snipplr.com/view/46057/salsa-template-script-to-generate-dynamic-titles</link>
      <description>&lt;p&gt;This was developed for 1Sky to write out titles to the template.  Thsi signle template can handle many DIA pages.  (Donation, Action, TAF).  It can determine what kind of page it is on by reading the URL and can even handle short URLs&lt;/p&gt;</description>
      <pubDate>Thu, 23 Dec 2010 04:37:00 UTC</pubDate>
      <guid>https://snipplr.com/view/46057/salsa-template-script-to-generate-dynamic-titles</guid>
    </item>
    <item>
      <title>(jQuery) New Salsa Error Checking - powerthru</title>
      <link>https://snipplr.com/view/42318/new-salsa-error-checking</link>
      <description>&lt;p&gt;SO with the addition of Action 3 framework, we have discovered new Salsa form error checking. Â  The way Salsa used to do its error checking was to submit the page with the values it had. Â WHen those values hit theÂ processingÂ page, that page would determine if required fields were missing. Â If they were missing it would redirect to the form page and display a message that required fields were missing.\r\nNow with Action 3.0 the form validation happens on the page before it submits. \r\n\r\nHere you can see it reads the required fields into an array, loops thru the array looking for inputs with that name. Â If it finds that the inputs have no value, it assigns a new class to the input, errorInput, which highlights the input with a red box. Â \r\n\r\nWhat is also interesting is it seems to do the post inside this function as well. Â I had noticed this page:\r\nhttp://act.truemajorityaction.org/p/salsa/web/common/public/content?content_item_KEY=50 flashed what seemed to be itself before the redirect. Â I believe that it is due to the post function.&lt;/p&gt;</description>
      <pubDate>Fri, 15 Oct 2010 04:52:50 UTC</pubDate>
      <guid>https://snipplr.com/view/42318/new-salsa-error-checking</guid>
    </item>
    <item>
      <title>(SQL) find one string inside another string, comparing two columns - powerthru</title>
      <link>https://snipplr.com/view/42185/find-one-string-inside-another-string-comparing-two-columns</link>
      <description>&lt;p&gt;in this case, we wanted to match fields where the district field in table b contained things like "LAM2-OUTSIDETOWN" and we wanted to match that to fields in table a which only had "LAM2" in them. "INSTR" ("in string") is our friend:&lt;/p&gt;</description>
      <pubDate>Wed, 13 Oct 2010 16:18:45 UTC</pubDate>
      <guid>https://snipplr.com/view/42185/find-one-string-inside-another-string-comparing-two-columns</guid>
    </item>
    <item>
      <title>(SQL) Remove trailing newlines from database fields - powerthru</title>
      <link>https://snipplr.com/view/42184/remove-trailing-newlines-from-database-fields</link>
      <description>&lt;p&gt;sometimes we botch an import, and end up with return or newline characters in the field. So fields which should be empty have \r in them, or fields with text data have an invisible trailing newline. This makes it impossible to match the text values. This sql statement removes the \r characters in a field.&lt;/p&gt;</description>
      <pubDate>Wed, 13 Oct 2010 16:15:38 UTC</pubDate>
      <guid>https://snipplr.com/view/42184/remove-trailing-newlines-from-database-fields</guid>
    </item>
    <item>
      <title>(JavaScript) require one of three Salsa group checkboxes to be selected - powerthru</title>
      <link>https://snipplr.com/view/42112/require-one-of-three-salsa-group-checkboxes-to-be-selected</link>
      <description>&lt;p&gt;We set up a voting page, where supporters would choose one of three candidates (only two are shown in the snippet). By clicking the checkbox, the supporter would add themselves to a Salsa group. This way only one vote for a candidate by a supporter would count, it would be easy to find the count for each candidate, and it would be easy to find the supporters who picked each candidate. &#13;
&#13;
We wanted to make it "required" to select one of the checkboxes, but we couldn't simply make the checkbox required because then supporters would be required to choose THAT checkbox. The solution was to add another field, called pac_voted, and make it a hidden field, and require THAT field to be filled out. Then we used the javascript shown here to fill out the pac_voted field whenever any of the groups checkboxes was selected. This way if no checkbox was selected, the error checking on the page reported that a required field was missing; but if any checkbox was checked, the page passed error checking.&lt;/p&gt;</description>
      <pubDate>Tue, 12 Oct 2010 16:06:27 UTC</pubDate>
      <guid>https://snipplr.com/view/42112/require-one-of-three-salsa-group-checkboxes-to-be-selected</guid>
    </item>
    <item>
      <title>(JavaScript) Check form checkbox when the label is clicked - powerthru</title>
      <link>https://snipplr.com/view/42102/check-form-checkbox-when-the-label-is-clicked</link>
      <description>&lt;p&gt;this is a way to deal with the fact that we can\'t reliably make checkboxes look larger on forms. So instead, we surround the form with a colored div, and set it up so that when the user clicks on the label next to the checkbox it checks the box.&lt;/p&gt;</description>
      <pubDate>Tue, 12 Oct 2010 13:08:26 UTC</pubDate>
      <guid>https://snipplr.com/view/42102/check-form-checkbox-when-the-label-is-clicked</guid>
    </item>
    <item>
      <title>(Bash) strip lines from multiple files - powerthru</title>
      <link>https://snipplr.com/view/42039/strip-lines-from-multiple-files</link>
      <description>&lt;p&gt;This removes the first six lines from a set of .csv files and writes them to a subdirectory, using awk&lt;/p&gt;</description>
      <pubDate>Mon, 11 Oct 2010 12:22:53 UTC</pubDate>
      <guid>https://snipplr.com/view/42039/strip-lines-from-multiple-files</guid>
    </item>
    <item>
      <title>(Bash) strip text from the middle of all filenames in a directory - powerthru</title>
      <link>https://snipplr.com/view/42038/strip-text-from-the-middle-of-all-filenames-in-a-directory</link>
      <description>&lt;p&gt;Expects all files to be in the current directory; does not recurse into subdirectories. Replace "TEXTTOREMOVE" with the text you wish to remove from the filename. Replace *.csv with a search term appropriate for your situation.&lt;/p&gt;</description>
      <pubDate>Mon, 11 Oct 2010 11:23:33 UTC</pubDate>
      <guid>https://snipplr.com/view/42038/strip-text-from-the-middle-of-all-filenames-in-a-directory</guid>
    </item>
    <item>
      <title>(Bash) strip leading text from all filenames in a directory - powerthru</title>
      <link>https://snipplr.com/view/42037/strip-leading-text-from-all-filenames-in-a-directory</link>
      <description>&lt;p&gt;Execute on the command line. Assumes all files are in the current directory; does not recurse into subdirectories. Replace "*.html" with correct search term for your situation; replace "FS-" with the leading text you wish to remove. This example removes the text FS-  from all files which end in .html&lt;/p&gt;</description>
      <pubDate>Mon, 11 Oct 2010 11:11:15 UTC</pubDate>
      <guid>https://snipplr.com/view/42037/strip-leading-text-from-all-filenames-in-a-directory</guid>
    </item>
  </channel>
</rss>
