finos / messageml-utils

MessageML is a markup language used by the Symphony Agent API for representing messages, including formatting (bold, italic, numbered and unnumbered lists etc.) and entity data representing structured objects.
https://docs.developers.symphony.com
Apache License 2.0
12 stars 28 forks source link

MessageML and PresentationML label attribute - Element Radio, Checkbox #191

Closed symphony-mariacristina closed 4 years ago

symphony-mariacristina commented 4 years ago

Add label attribute to the following elements: <radio> , <checkbox>

Attribute name Optional Type Max length Attribute description
label true String 64 Definition of the label that will be displayed on top of the Element DOC
Attribute name Corresponding MessageML attribute Notes
<label> label The label attribute will be transform as standard tag, see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label

Examples

(Please note that {uniqueLabelId} is a 10 alphanumeric characters short id, url-friendly)

Checkbox

<!-- MessageML -->
<messageML>
   <form>
      <checkbox name="fruits" value="orange">Orange</checkbox> 
   </form>
</messageML>

<!-- PresentationML -->
<div data-format="PresentationML" data-version="2.0"> 
   <form id="example"> 
      <div class="checkbox-group">
         <input id="checkbox-{uniqueLabelId}" type="checkbox" name="fruits" value="orange">
         <label for="checkbox-{uniqueLabelId}">Orange</label>
      </div> 
   </form> 
</div>

Radio

<!-- MessageML -->
<messageML>
   <form id="radio-form">
       <radio name="groupId" value="value01">First</radio>
       <radio name="groupId" value="value02">Second</radio>
       <button type="action" name="actionName">Send</button>
   </form>
</messageML>

<!-- PresentationML -->
<div data-format="PresentationML" data-version="2.0">
   <form id="radio-form">
       <div class="radio-group">
          <input id="radio-{uniqueLabelId} type="radio" name="groupId" value="value01"/>
          <label for="radio-{uniqueLabelId}>First</label>
       </div>
       <div class="radio-group">
          <input id="radio-{uniqueLabelId} type="radio" name="groupId" value="value02"/>
          <label for="radio-{uniqueLabelId} >Second</label>
       </div>
       <button type="action" name="actionName">Send</button>
   </form>
</div>