Search code examples
javascriptformsalpacajs

Alpaca form: loading schema and options from .json file


I'm trying to use Alpaca to generate a configurable form. I would like to do as showed here: http://www.alpacajs.org/demos/bootstrap/customer-profile/create-simple-form.html (load options and schema from json file). I wrote the following simple code:

    <body>
     <div id="form"></div>
     <script type="text/javascript">
         $(document).ready(function() {
             $("#form").alpaca({
                 "schemaSource": "path_to_my_schema/schema.json"
             });
         });
     </script>
 </body>

It looks super simple but it is not working...I would appreciate any help!


Solution

  • If it's in the same directory, just "./schema.json" should do it.