0

I am working on a built-in create and edit forms inside my list. now the list contain a managed metadata field named "Customer Name". now i want to capture when this field is changed, to populate a dropdownlist values based on the selected term.

now i checked the markup, and it looks as follow:-

enter image description here

where seems there will be a hidden input field, and two Divs which control the managed metadata.. so i am not sure how i can capture when this managed metadata field is changed? i tried something as follow:-

$("input[id='CustomerName']").onchange(function() {

$("input[id^='CustomerName']").onchange(function() {

i also try using change() instead of onchange(). but did not solve the issue...

  • 1
    Did you check this sharepoint.stackexchange.com/questions/160833/… ? – kekub May 24 '17 at 12:59
  • @kekub thanks for the link which seems very useful.. but i am not sure how i can register this custom event inside my edit and create forms? i can use script editors ?? – john Gu May 24 '17 at 13:08
  • 1
    args.editableRegion gives you the node in the dom tree that has been modified in the given example. From there you can go through the parentNodes to check the field. – kekub May 24 '17 at 13:34
  • 1
    Sorry, I only did this a few years ago when we were on 2010. You can try to ask in the original question. I was referring to this quote: "By the way, I managed to restrict the control by restricting the condition (args.editableRegion.parentNode.parentNode.parentNode.FieldN‌​ame == 'Department')" – kekub May 24 '17 at 13:38
  • 1
    did you wrap that change method inside a $(document).ready() function? Maybe it can't find that dom object whenever it's called. – Mike May 24 '17 at 17:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.