i have a question, where i need a suggestion, in m...
# cfml-beginners
g
i have a question, where i need a suggestion, in my code i have this at lot of places
Copy code
<cfselect class="Select" style="width: 75%" name="Sales" query="qry" value="SaleID" display="Title" selected="#SelectedValue#" />
 
<script>
  $('.Select').select2({
    placeholder: 'Select Sales',
    allowClear: true
  });
</script>
So my plan is to replace cfselect with normal select and use it, but should i convert this into a custom tag or cffunction so i can reuse it all the places i needed
m
I think Mr. Cameron answered this on SO a long time ago: https://stackoverflow.com/a/22546169/1599011
g
forget it, i used my own creation i asked for suggestion and if do not want to provide, i do not care
m
I don't understand; does this SO answer not meet your needs?
g
nopes But Thanks for the link
m
Okay, in hopes of better helping, how does this miss the mark?
s
@Myka Forrest FWIW i think you provided a helpful link for this question, Im not sure why there was need for his negative response. The question, I think, was asking more about the convenience of putting all of the code in a customTag vs. a function. And the answer would probably lean more toward a custom tag to mimic the
cfselect
’s functionality, but instead using jquery’s Select2. That being said, arguably neither solution is a good one since you would be including a javascript dependency in a CFML custom tag. which we have seen go bad with built in features such as
cfajax
👍 1
m
@Evil Ware, wrong thread?
g
@Myka Forrest it's seems the thread hacked