This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($scope.action) { | |
var method = submissionData._id ? 'put' : 'post'; | |
$http[method]($scope.action, submissionData, { | |
disableJWT: true, | |
headers: { | |
Authorization: undefined, | |
Pragma: undefined, | |
'Cache-Control': undefined | |
} | |
}).success(function(submission) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This will request all submissions where they provided "Smith" in the Last Name field. | |
* | |
* GET - https://yourproject.form.io/yourform/submission?data.lastName=Smith | |
*/ | |
var request = require("request"); | |
var options = { | |
method: 'GET', | |
url: 'https://yourproject.form.io/yourform/submission', | |
qs: {'data.lastName': 'Smith'}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Alabama": { | |
"address_components": [{ | |
"long_name": "Alabama", | |
"short_name": "AL", | |
"types": ["administrative_area_level_1", "political"] | |
}, { | |
"long_name": "United States", | |
"short_name": "US", | |
"types": ["country", "political"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
['$scope', function($scope) { | |
var debounce = function(cb) { | |
var timeout = null; | |
return function(data) { | |
if (timeout) { | |
clearTimeout(timeout); | |
} | |
timeout = setTimeout(function() { | |
cb(data); | |
}, 200); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var forceFieldError = function(key, error) { | |
var formioFormScope = angular.element('[name="formioForm"]').scope(); | |
var formioScope = formioFormScope.$parent; | |
var formioForm = formioFormScope.formioForm; | |
var component = FormioUtils.getComponent(formioScope.form.components, key); | |
component.customError = error; | |
formioForm.$pristine = false; | |
formioForm.$valid = false; | |
formioForm[key].$setValidity('custom', false); | |
formioForm[key].$pristine = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p data-height="600" data-theme-id="light" data-slug-hash="xVyMjo" data-default-tab="result" data-user="travist" data-embed-version="2" data-pen-title="Form.io Form Building and Rendering" class="codepen">See the Pen <a href="http://codepen.io/travist/pen/xVyMjo/">Form.io Form Building and Rendering</a> by Travis Tidwell (<a href="http://codepen.io/travist">@travist</a>) on <a href="http://codepen.io">CodePen</a>.</p> | |
<script async src="https://production-assets.codepen.io/assets/embed/ei.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('myApp') | |
.controller('FormController', ['$scope', 'Formio', function($scope, Formio) { | |
$scope.form = null; | |
$scope.submission = {data: {}}; | |
var formio = (new Formio('https://myproject.form.io/myform')); | |
var getAutoIncrement = function(fieldName, cb) { | |
formio.loadSubmissions({params: {sort: '-data.' + fieldName, limit: 1}}).then(function(subs) { | |
var value = 0; | |
if (subs.length) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.center-loader { | |
font-size: 2em; | |
position: absolute; | |
left: 50%; | |
top: 50%; | |
margin-top: -0.5em; | |
margin-left: -0.5em; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var header = true; | |
module.exports = function(record, next) { | |
if (header) { | |
// Ignore the header row. | |
header = false; | |
return next(); | |
} | |
next(null, { | |
data: { | |
propertyId: record[0], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('myApp') | |
.controller('FormSubmissionController', [ | |
'Formio', | |
'$http', | |
function(Formio, $http) { | |
$scope.form = null; | |
// Render the form manually. This will not call the Form.io API when it is submitted, but rather | |
// just trigger the formSubmission event. | |
(new Formio('https://myproject.form.io/myform')).loadForm().then(function(form) { |