I'd like to create a form from a json array of fields, and have it call a callback on submit.
For example, I'd like something like the following, that would create a form with 3 fields, and call the onSubmitCallback when submit was clicked.
<script type="text/javascript">
var fc = new FormCreator({
owner: document.body,
fields: [
{'name':'name', 'title':'name', 'value':'test'},
{'name':'last_day', 'title':'last day', 'value':'test asdfas fdj'},
{'name':'ez', 'title':'how', 'value':'test asdf'}
],
config: {
firstColWidth:'200px'
},
onSubmitCallback: function(data, form){
console.log(data);
return false;
}
});
</script>
Are there any examples out there for doing this?