Preset Cascading Value from JS on Form Load

Forums Cascading dropdowns Preset Cascading Value from JS on Form Load

Viewing 2 reply threads
  • Author
    • #11693
      Ian Patrick

      Hello Alexander,
      I hope you can help, I want to set a start value in a cascading dropdown field from JS. I’ve tried using setFieldValue(‘Product’,_lclProduct); where ‘Product’ is the cascading field, (SPFieldText) and _lclProduct is the initial value I want to set the field to. The cascading field works fine from user input, but trying to set it from JS does not populate the value into the Product field. How can I best do this?

      Thank you in advance.

    • #11695
      Ian Patrick

      Alexander, I’ve read other items in the forum now that suggest this approach won’t work. I’ve used an alternative solution that seems to work Ok for me. I prefill the text fields using SPServices then open the list item this prepopulates the Cascade field as I want and all seems to work fine.



    • #11724
      Alexander Bautz

      You should be able to use setFieldValue to set the field – which version of the cascading dropdown plugin are you using? – this might be a problem with an older version.

      In your example – is _lclProduct a variable? – if not, you must use quotes like this:

Viewing 2 reply threads
  • You must be logged in to reply to this topic.