Story: Split form binding form its generation

  • Developer: othree
  • Response to: gugod
  • Estimate point: 6

Story status

Processing.

Finished: calendar.

Story description

So it can also be used when people already have HTML.

Synopsis code

Generation entire form:

jQuery("div#form1").form({
...
})

Bind jquery-form to current HTML.

jQuery("input#input1").form({render_as: 'calendar'});
jQuery("input#input1").form({render_as: 'datetime_menu'});

jQuery("input#input1").form({render_as: 'map'}, function(x, y) {
        $(this).val("geo:lon=" +x ";geo:lat=" +y);
    }
)

  • Can have plugin to extend .form
  • Original input can be set to hidden
  • Can have callback like synopsis.

Story test

  • JS test
    • Test page has HTML form, and can ask jquery-form to bind its own handlers
    • Make sure it's feasible for plugin.