Preset Cascading Value from JS on Form Load

Home Forums Cascading dropdowns Preset Cascading Value from JS on Form Load

Viewing 2 reply threads
  • Author
    Posts
    • #11693
      Ian Patrick
      Participant

        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.
        Ian

      • #11695
        Ian Patrick
        Participant

          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.

          Thanks

          Ian

        • #11724
          Alexander Bautz
          Keymaster

            Hi,
            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:

            setFieldValue("Product","_lclProduct");
        Viewing 2 reply threads
        • You must be logged in to reply to this topic.