Question: (part 1) I am looking for the most efficient way to set my form input values based on the results of my cfquery. My form fields all match
Please try the following jQuery code snippet.
var selDefualtVal = '#getFormData.product_category#';
jQuery(document).ready(function () {
jQuery("#product_category option[value='"+selDefualtVal+"']").attr("selected","selected");
});
for select you can try a comparison for each option values like:
<select name="product_category" id="product_category">
<option value="ts8-it" <cfif CompareNoCase(getFormData.product_category,"ts8-it") EQ 0>selected="selected"</cfif> >TS8-Data Center </option>
Same way you can try the radio fields,
<input id="rails_yes" type="radio" name="19_Rails" value="yes" <cfif getFormData.19_Rails>checked="checked"</cfif> >
<input id="rails_no" type="radio" name="19_Rails" value="no" <cfif NOT getFormData.19_Rails>checked="checked"</cfif> >