Skip to content

Instantly share code, notes, and snippets.

View randallknutson's full-sized avatar

Randall Knutson randallknutson

View GitHub Profile
.control-label {
font-weight: bold;
}
label {
text-align: right;
width: 100%;
}
alert('loaded');
// Place this inside the page's controller for a form
// You'll need to inject $http and $scope into the controller.
$scope.$on('formSubmission', function(err, submission) {
$http({
method: 'POST',
url: 'http://mydomain.com/mypath',
eaders: { 'Content-Type': 'application/json' },
data: submission.data,
disableJWT: true
(function() {
'use strict';
angular
.module('formioApp')
.config([
'formioComponentsProvider',
function(
formioComponentsProvider
) {
formioComponentsProvider.register('jobrouting', {
@randallknutson
randallknutson / formwrapper.js
Created October 14, 2016 19:36
Create form wrapper with submit message.
angular.module('spryapp')
.directive('spryform', function () {
return {
restrict: 'E',
replace: true,
scope: {
src: '=',
message: '=',
form: '=?',
submission: '=?'
{
"title": "Alerts",
"display": "form",
"type": "form",
"name": "alerts",
"path": "alerts",
"components": [
{
"lockKey": true,
"type": "hidden",
var React = require('react');
var ReactDOM = require('react-dom');
var Formio = require('react-formio');
require('react-widgets/dist/css/react-widgets.css');
require('react-formio/formio.css');
var formChange = function(submission, key, value) {
console.log('change', submission.data, key, value);
}
var React = require('react');
var ReactDOM = require('react-dom');
var Formio = require('react-formio');
var Formiojs = require('formiojs');
var CalcForm = React.createClass({
getInitialState: function() {
return {
score: this.props.value || 0
};
@randallknutson
randallknutson / update-1.0.0.js
Last active August 29, 2015 14:25 — forked from zackurben/gist:1f2df3092e3547a199e0
Update formio database to version 1.0.0
/**
* Simple utility function to resize an array after elements have been removed.
*
* @param arr
* The array to resize.
* @returns {Array}
*/
var resizeArray = function(arr) {
if (!(arr instanceof Array)) {
return [];
var request = require('request');
request(
{
url: 'https://{appname}.form.io/app/api/{resourcename}/submission?limit=20',
method: 'GET',
headers: {
'x-jwt-token': token,
'Range-Unit': 'items',
'Range': '0-20'