Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <input class="string required brand_xref_catalog_brand ui-autocomplete-input"
  2. data-id="824" required="required" aria-required="true" type="text"
  3. name="brand_xref[catalog_brand]" id="brand_xref_catalog_brand"
  4. autocomplete="off">
  5.  
  6. $(".brand_xref_catalog_brand").autocomplete
  7. source: (request, response) ->
  8. options =
  9. term: request.term
  10. $.get "/search_catalog_brands", options, (data) ->
  11. if data.length == 0
  12. alert "No brands found that contain with " + request.term + "."
  13. response data
  14. minLength: 3
  15. select: (event, ui) ->
  16. $("#brand_xref_catalog_brand_id").val(ui.item.id)
  17.  
  18. $(this).data('id')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement