<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to get share form value from different fields? in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-share-form-value-from-different-fields/m-p/19551#M8639</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The "form" parameter provided to the validator function is an instance of "Alfresco.forms.Form" (YUI module). This contains a "formId" property that you can use to retrieve the DOM element for the form. Via the DOM API you can iterate over all form input elements and check the name of the elements without having to resolve it by ID. Since you get the current field as the "field" parameter you can use its name to come up with a convention of which other fields should be relevant for a specific validation. E.g. you have a "xyz_aaaToSubtract" and a "xyz_aaaBase" field, you could add a generic validator to check that the "*ToSubtract" field is always less-or-equal the "*Base" field by focussing on the field suffix and extracting the common base name.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Mar 2017 12:30:02 GMT</pubDate>
    <dc:creator>afaust</dc:creator>
    <dc:date>2017-03-20T12:30:02Z</dc:date>
    <item>
      <title>How to get share form value from different fields?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-share-form-value-from-different-fields/m-p/19548#M8636</link>
      <description>Hello, In my share config custom form, I have defined a validation handler on the field by the javascript file custom-form-handler.js&amp;lt;config&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;forms&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dependencies&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;js src="/js/custom-form-handler.js"/&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/dependencies&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/forms&amp;gt;&amp;lt;/</description>
      <pubDate>Fri, 17 Mar 2017 15:33:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-share-form-value-from-different-fields/m-p/19548#M8636</guid>
      <dc:creator>sprincess</dc:creator>
      <dc:date>2017-03-17T15:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to get share form value from different fields?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-share-form-value-from-different-fields/m-p/19549#M8637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The validators in Share forms are always only "field" validators. They are not actually designed to validate values of multiple fields in conjunction. About the only thing you could do is try and lookup any other fields from the "form" parameter that is provided to you. This ultimately means you'd have to come up with some form of name convention to identify related fields or resort to hard-coding of field names in the JS code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Mar 2017 15:04:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-share-form-value-from-different-fields/m-p/19549#M8637</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2017-03-19T15:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to get share form value from different fields?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-share-form-value-from-different-fields/m-p/19550#M8638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Axel for the response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually, I'm quite new on the share form customization....&lt;/P&gt;&lt;P&gt;From "form" parameter, it seems I could not find any other fields information, something I found was near to the result but just the event name "&lt;SPAN class="" style="min-width: 0px; min-height: 0px; box-sizing: border-box; color: #881391; flex-shrink: 0; font-family: Consolas, 'Lucida Console', 'Courier New', monospace; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: nowrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"&gt;_fieldEvents&lt;/SPAN&gt;&lt;SPAN class="" style="min-width: 0px; min-height: 0px; box-sizing: border-box; flex-shrink: 0; padding-right: 5px; color: #212121; font-family: Consolas, 'Lucida Console', 'Courier New', monospace; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: nowrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="min-width: 0px; min-height: 0px; box-sizing: border-box; position: relative; vertical-align: baseline; color: #212121; display: inline-block; font-family: Consolas, 'Lucida Console', 'Courier New', monospace; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: nowrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"&gt;Object&lt;/SPAN&gt;".&lt;/P&gt;&lt;P&gt;May I know how could I lookup the other fields from the "form" parameter? Let's assume I have a defined field in share-config-custom.xml called "wfm:itemA".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addition, I would like to know more detail on how to identify related field by name convention or hard-coding of field names?&lt;/P&gt;&lt;P&gt;Is it meaning to change the field name from:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN style="min-width: 0px; min-height: 0px; box-sizing: border-box;"&gt;field = &lt;SPAN class="" style="min-width: 0px; min-height: 0px; box-sizing: border-box; position: relative; vertical-align: baseline; color: #881280; display: inline-block;"&gt;&lt;SPAN class="" style="min-width: 0px; min-height: 0px; box-sizing: border-box; color: #881280;"&gt;input&lt;/SPAN&gt;&lt;SPAN class="" style="min-width: 0px; min-height: 0px; box-sizing: border-box; color: #1a1aa6; unicode-bidi: -webkit-isolate;"&gt;#template_x002e_start-workflow_x002e_start-workflow_x0023_default-startWorkflowForm-alf-id1_prop_wfm_quantity1&lt;/SPAN&gt;&lt;SPAN class="" style="min-width: 0px; min-height: 0px; box-sizing: border-box; color: #994500; unicode-bidi: -webkit-isolate;"&gt;.number.invalid&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="min-width: 0px; min-height: 0px; box-sizing: border-box;"&gt;to something like&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN style="min-width: 0px; min-height: 0px; box-sizing: border-box;"&gt; shareFormFieldCustom_prop_wfm_quantity1?&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV class="" style="min-width: 0px; min-height: 0px; box-sizing: border-box; position: relative;"&gt; &lt;/DIV&gt;&lt;DIV class="" style="min-width: 0px; min-height: 0px; box-sizing: border-box; position: relative;"&gt;Sorry for my poor understanding,&lt;/DIV&gt;&lt;DIV class="" style="min-width: 0px; min-height: 0px; box-sizing: border-box; position: relative;"&gt;thanks for your kindly advise!&lt;/DIV&gt;&lt;DIV class="" style="min-width: 0px; min-height: 0px; box-sizing: border-box; position: relative;"&gt; &lt;/DIV&gt;&lt;DIV class="" style="min-width: 0px; min-height: 0px; box-sizing: border-box; position: relative;"&gt;BR,&lt;/DIV&gt;&lt;DIV class="" style="min-width: 0px; min-height: 0px; box-sizing: border-box; position: relative;"&gt;Mandy&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Mar 2017 18:49:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-share-form-value-from-different-fields/m-p/19550#M8638</guid>
      <dc:creator>sprincess</dc:creator>
      <dc:date>2017-03-19T18:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to get share form value from different fields?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-share-form-value-from-different-fields/m-p/19551#M8639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The "form" parameter provided to the validator function is an instance of "Alfresco.forms.Form" (YUI module). This contains a "formId" property that you can use to retrieve the DOM element for the form. Via the DOM API you can iterate over all form input elements and check the name of the elements without having to resolve it by ID. Since you get the current field as the "field" parameter you can use its name to come up with a convention of which other fields should be relevant for a specific validation. E.g. you have a "xyz_aaaToSubtract" and a "xyz_aaaBase" field, you could add a generic validator to check that the "*ToSubtract" field is always less-or-equal the "*Base" field by focussing on the field suffix and extracting the common base name.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Mar 2017 12:30:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-share-form-value-from-different-fields/m-p/19551#M8639</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2017-03-20T12:30:02Z</dc:date>
    </item>
  </channel>
</rss>

