ColdFusion how to set form input values from the results of a cfquery?

前端 未结 2 1193
夕颜
夕颜 2021-01-22 15:01

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

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-22 15:53

    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");
    });
    

提交回复
热议问题