Skip to main content

Get an element from form template

Comments

2 comments

  • Zendesk API User
    Author: felix_reinhold - 3/23/2017 7:52

    Hello Javier,

    you should take a look at the "PARAMS"-section in the FS_BUTTON documentation.

    Just pass the field as param:

    <FS_BUTTON name="cs_selectAllButton" hidden="no" onClick="script:test_selectallboxes">

            <LANGINFOS>

              <LANGINFO lang="*" label="Select All" description="Select all options."/>

            </LANGINFOS>

        <PARAMS>

              <PARAM name="checkboxField">#field.cs_checkbox</PARAM>

        </PARAMS>

    </FS_BUTTON>

    Now in your script you can access the FormField via the variable checkboxField.

    By using checkboxField.set(Object value) you can set the value of the field (you don't need to do lock- or save-operations in your script!)

    Best regards

    Felix

    0
  • Zendesk API User
    Author: javier_fernande - 3/23/2017 12:48

    Thank you so much! This is the correct answer to my (silly :smileysad: ) problem.

    0

Please sign in to leave a comment.