How to make a simple form and submit that form data to next page in mojito

i want to make a simple form as my web app and require that when i click on submit button it should send the form data to next page , how to do that?

1 Reply
  • Rendering a form in HTML is straightforward.

    In the form's action attribute provide the url say "/my_form_submit_url". Make appropriate entries in the routes.json.

    In the controller add a method like the following my_form_submit_url : function(ac) { ar req = ac.http.getRequest(), i = 0, fs = require('fs'), util = require('util');

            var r_files = [];
            var brand = ac.params.getFromBody('brand');
            var product = ac.params.getFromBody('product');
            var description = ac.params.getFromBody('description');

    ---do whatever you want to do with the post attributes ---- }

    Remeber to add the following addon in the requires array of your controller

    'mojito-params-addon', 'mojito-http-addon'


Recent Posts

in Yahoo! Mojito