Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="container-fluid" ng-app="myModule" ng-controller="DataAddController as vm">
  <div class="row">
    <div class="col-md-12">
      <h1>Not a Google Form</h1>
      <script type="text/javascript">
        window.submitted = false;
      </script>
      <iframe id="hiddenIframe" name="hiddenIframe" onload="if(window.submitted||false){alert('Response saved. You may navigate away now');}"
        style="display: none;"></iframe>
      <div class="container">
        <form action="https://docs.google.com/forms/d/e/1FAIpQLSdF5V5oVl-p3UA2loK-Rbij1tX81HfckHDiSMpENeJ9vHyTMQ/formResponse" onsubmit="window.submitted=true;" target="hiddenIframe" method="POST">
          <div class="form-group row">            
            <div class="col-sm-10">
              <input type="text" name="entry.501482089" ng-model="vm.response" ng-required="true" id="inputStatus" />                
              <div editable-table form-instance="formInstance" data="vm.data" options="vm.options" heading="Optional Heading">
            </div>
          </div>
          <div class="form-group row">
            <div class="offset-sm-2 col-sm-10">
              <button type="submit" ng-disabled="!vm.submitEnabled" class="btn btn-primary">Submit</button>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                
              
            
!

JS

              
                // the form answers can be seen here: https://docs.google.com/spreadsheets/d/1Y1WJyISvDqigF26P847mUXosiHGeJAwiQU_04SqBIN0/edit?usp=sharing
angular.module('myModule', ['angularjs-editable-table']);

angular.module('myModule').controller('DataAddController', function($scope) {
  'ngInject';
  var vm = this;
  this.data = [{"partNo":"SWAS_BRO_1","qty":1,"bookingRef":"b4457897","notes":"suppose we might as well clarify our intentions here"}];   
  this.options = {
        disableDelete: false,
        minRecords: 1, // Restrict removing rows if less than given count
        columns: [
            {
                title: "Part Number",
                data: "partNo",
                type: {
                    name: "input",
                    required: true,
                    class: "text-center",
                    placeholder: "Enter part number"
                }
            },
            {
                title: "QTY",
                data: "qty",
                type: {
                    name: "input",
                    inputType: "text",
                    inputType: "number",
                    required: true,
                    class: "",
                    placeholder: "Enter quantity"
                }
            },
            {
                title: "Booking ref",
                data: "bookingRef",
                type: {
                    name: "input",
                    required: true,
                    class: "",
                    placeholder: "Enter booking reference"
                }
            },
            {
                title: "Notes",
                data: "notes",
                type: {
                    name: "input",
                    required: false,
                    class: "",
                    placeholder: ""
                }
            },
        ],
        callbacks: {

        },
        classes: {
            table: "table table-sm table-bordered",
            tableWrapper: "table-wrapper",
            pagination: ""
        },
        closeButton: {
            label: "remove",
            iconClass: "mdi mdi-close-circle",
            buttonClass: "btn"
        },
        pageLength: 10,
    };
  
  
  vm.response = JSON.stringify({data:[]});
  vm.submitEnabled = false;
  $scope.$watch('vm.data', function(newval, oldval) {    
    vm.submitEnabled = vm.data.length > 0; // do more fancy checks before allowing the form to submit
    vm.response = JSON.stringify(newval);//sync the value back to hidden field
  }, true);
  vm.onLoad = function() {
    if (window.submitted || false) {
      window.submitted = false;
    }
  };
});
              
            
!
999px

Console