Thoughts n Musings

Search multiple database columns

Quick note, when searching multilpe database columns, avoid using CONCAT I had a terrible time getting it work. Instead I used   where FN +' '+LN like <cfqueryparam cfsqltype="cf_sql_varchar" value="%williams%">

and EE_STAT not like 'T%'

Read More
Comments (0)
Utlizing the JSON APi
By Brian Fescoe
June 22, 2016

Here are two different example of how to use the JSON api in MURA. One pulls back a page based off of a content ID Number the other will display multiple results via a content collection.

Read More
Comments (0)
BootStrap Validation Plugin
By Brian Fescoe
February 3, 2016
When using the bootstrap validation plugin and jQuery post I had issues with the form still submitting even though the submit button was disabled. This lead to incomplete records in the database to account for this I need to add the following code.

 

Read More
Comments (0)
Add clicked checkboxes to serialized jQuery string
By Brian Fescoe
January 22, 2016
Quick way to add vars at the end of a serialized jQuery form. The below content uses checkboxes but you could use any variable.
 
$("#btnAddNew").button().click(function() {
var programList = $('.programs:checked').map(function() {return this.value;}).get().join(',') // capture checkboxes
var disciplineList = $('.discipline:checked').map(function() {return this.value;}).get().join(',') // capture checkboxes
var theData = $("#addSchool").serialize() + '&programList=' + programList + '&dL=' + disciplineList;
 
}

 

 

Read More
Comments (0)
Benefits of using REFind vs contains in ColdFusion
By Brian Fescoe
July 2, 2015

If you have a need to break apart a serialized ARGUMENT string from jQuery and JSON, say for list of questions that are getting submitted @ one time it is best to use REFind rather than contains take a look at the example below. 

The url encoded string has answers, feedback elements and urls for a single question. After decoding the string and replacing the + and & symbols that are added when doing an ajax post. (as an aside you will need to decode twice to show the special characters when rendering)

Read More
Comments (0)
Paging the DataTables plug-in using jQuery load
By Brian "DudeHammer" Fescoe
June 18, 2015

I’ve decided to use the DataTables plug-in to list different medical schools for a current project I’m working on with the hospital. All the data is being loaded via AJAX from a CFC, which in it self is pretty neat. If you have never tried using this plug-in to display your data I would recommend giving it a try, you can find it @ www.datatables.net.  

Read More
Comments (1)
Use jQuery to detect if radio button is selected.
By Brian "DudeHammer" Fescoe
April 1, 2015

I’m creating an online test that returns all the question text,image associated it available and a series of questions. I had a need to check if a current questions radio buttons is selected, if not force the user to select. I was returning all the generated test questions dynamically from ajax and hiding every question but the 1st. 

Read More
Comments (0)
Escaping pound (#) symbol for CF ajax post
By Brian Fescoe
September 26, 2014

Almost everyone out there who uses CF knows that in order to escape the # symbol just simply make add another # so it looks like so “##”.  But what if it’s coming from a POST value; say from a form using Ajax?

For example my string looked like this 'myInputs=&myInputs1=#+<89Rtiahsdf>1&myInputs2=34jarlfkj7&#’ My goal was to remove ‘myInputs', ‘=‘ and the ‘&' symbol then separate everything putting it into an array.

postion one  = #+<89Rtiahsdf>;1
postion two = 34jarlfkj7&#

The string above has two issues with it one it has pound symbols which CF will throw an error if encounters one and there is not a closing one. Second notice the & at the end or the string, well that little beauty caused me to have 3 entries instead of two.

Read More
Comments (0)
jQuery MultiSelect
By Brian Fescoe
October 14, 2014
Interesting issue the past couple of days. I’ve been using the jQuery multiselect for a project that I’ve been working on the last couple of days. Getting the multiselect to display the values and names was the easy part. I had issues however when I wanted to update the form and show the previously selected options in the multiselect. The values get stored in the a data base column as 0,1,2,3,4
 
This was all coming from a JSON return which was rendering the info on screen, not sure that really matters with the issue I was having or not but it’s worth a mention.
Read More
Comments (0)