Skip to content
Snippets Groups Projects
Select Git revision
  • 9f0cbdd3bb97c61fa5cfb3d8c4189730e5e01b54
  • master default protected
  • 1.31
  • 4.34.1
  • 4.34.0
  • 4.33.1
  • 4.33.0
  • 4.32.2
  • 4.32.1
  • 4.32.0
  • 4.31.0
  • 4.30.1
  • 4.30.0
  • 4.29.1
  • 4.29.0
  • 4.28.0
  • 4.27.0
  • 4.26.0
  • 4.25.5
  • 4.25.4
  • 4.25.3
  • 4.25.2
  • 4.25.1
23 results

field-set.mjs

Blame
  • form-example.html 10.77 KiB
    <p>
        On this page you will find a sample implementation for many HTML5 controls. The binding is set up in both
        directions, so that a change to the control also causes a change to the values, and changes to the values cause a change to the
        control.
    </p>
    
    <p>
        You can save the updater as a temporary variable in the console. In our case Chrome assigns the variable <code>temp1</code> to
        the object.
    </p>
    
    <p>
        Note that instead of <code>temp1</code> you have to take the variable from your browser.
    </p>
    
    <p>
        And then access the data array using <code>temp1.getSubject().</code>
    </p>
    
    <p>
        For example, to enable the checkbox you can set <code>temp1.getSubject().value.checkbox="YES"</code>. To deactivate the checkbox
        you have to remove the value <code>temp1.getSubject().value.checkbox=undefined</code>
    </p>
    
    <p>
        Note that you have to take the variable from your browser instead of temp1.
    </p>
    
    <p>
        At the bottom you will find the JSON with all values
    </p>
    
    <h3>Examples</h3>
    
    <!--<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.24.1/prism.min.js"></script>-->
    <!--<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.24.1/themes/prism-coy.css" rel="stylesheet"/>-->
    
    <template id="example1">
    
        <style>
    
            [readonly] {
                background-color: #e9e9e9;
                border: 1px solid grey;
            }
    
            div {
                box-sizing: border-box;
            }
    
            .table {
                display: grid;
                grid-template-columns: 1fr 1fr 4fr;
            }
    
            .cell.control {
                padding: 5px 20px;
            }
    
            .cell.value {
                padding: 5px 20px;
            }
    
            .json {
                margin: 5px 20px;
                padding: 20px;
                border: 4px solid #424242;
                margin-top: 20px
            }