alpacajs

Alpaca - Is there a form onReady?

大憨熊 提交于 2020-04-18 05:29:21
问题 Using Alpaca js I am trying to use setValue of another alpaca form on the fly I get SyntaxError: JSON.parse: unexpected end of data at line 8 column 5 of the JSON data My guess is that its happening because the form is not rendered yet? is there a way to set its "onReady" function? Simple example to demonstrate the scenario: $(document).ready(function(){ createForm("alpacaForm1","firstName","Copy from this form","FORM1 value","string"); }); function updateForm(){ createForm("alpacaForm2",

Alpaca - Is there a form onReady?

拥有回忆 提交于 2020-04-18 05:29:05
问题 Using Alpaca js I am trying to use setValue of another alpaca form on the fly I get SyntaxError: JSON.parse: unexpected end of data at line 8 column 5 of the JSON data My guess is that its happening because the form is not rendered yet? is there a way to set its "onReady" function? Simple example to demonstrate the scenario: $(document).ready(function(){ createForm("alpacaForm1","firstName","Copy from this form","FORM1 value","string"); }); function updateForm(){ createForm("alpacaForm2",

getValue not working on custom template

我的未来我决定 提交于 2019-12-13 03:47:11
问题 I've been able to make my own field, using a costum template. This field consist in a textField followed by button at the end, on the same line, but I'm confronted to an issue. When I'm using form.getValue(), it does return the original values, I mean, if I modify 1 field and then do a getValue(), the modification won't be visible and I will still get the value I had when loading the form. I'm pretty sure there is a problem with my template but I can't figure what to do ! :( Here is my

Using remote data for autocomplete with Alpaca forms

邮差的信 提交于 2019-12-12 05:26:47
问题 I'm using Alpaca forms and pulling values for a form autocomplete field from a web service. I've worked through how to use this data as values for the autocomplete using jQuery and now need to use this data source within Alpaca forms, which uses typeahead.js and Bloodhound.js. I'm not quite sure how Alpaca interacts with these other JS libs. The code below returns an array of values in the autocomplete field, but of course only the matching value should be displayed and selectable. I'm not

Append Alpacajs form to existing form

泄露秘密 提交于 2019-12-11 01:26:27
问题 I'm trying to create a means of user input calculation, where input fields and calculation formula are set dynamically. For example, a have Number of apples and Price for one apple inputs, so I multiply inputs to get the price. In another case I have length , width and height inputs to calculate volume. I decided to store inputs, data and calculation function and reassemble the form form json with Alpacajs But calculation fields are only a part of a bigger form. So using $("#alpacaForm")

Meteor and Alpaca forms

懵懂的女人 提交于 2019-12-10 23:51:32
问题 I installed alpaca and alpaca-bootstrap mrt add alpaca mrt add alpaca-bootstrap and put the code from alpaca homepage to my template like below. And there is no way I can make it work. I also tried not to use mrt package, put javascript in different file... Anyone has a clue? Thx <template name="templates"> <div id="content"> <div class="container"> <div class="row"> <!--main content--> <div class="col-md-12"> <h2 class="title-divider"><span>Templates<span class="de-em"></span></span> <small

How to create a required conditional field using Alpaca?

天大地大妈咪最大 提交于 2019-12-07 03:46:17
问题 Does anyone know how I can define a required field which is dependant on another field? For example if field1 is marked true then field2 must be required, otherwise field 2 should not be filled. Here is my current attempt: "field1": { "title": "Field1:", "type": "string", "enum": ["true", "false"] }, "field2": { "title": "Field2:", "type": "integer", "dependencies": "field1", "required": true } 回答1: Alpaca's dependency system hides the dependant field if the dependency is not met, otherwise

How to create a required conditional field using Alpaca?

旧时模样 提交于 2019-12-05 07:34:57
Does anyone know how I can define a required field which is dependant on another field? For example if field1 is marked true then field2 must be required, otherwise field 2 should not be filled. Here is my current attempt: "field1": { "title": "Field1:", "type": "string", "enum": ["true", "false"] }, "field2": { "title": "Field2:", "type": "integer", "dependencies": "field1", "required": true } Alpaca's dependency system hides the dependant field if the dependency is not met, otherwise the field is shown and any options assigned to it such as validation options are also required. After looking