Commit 78d5e5c8 authored by Sven Franck's avatar Sven Franck

added form validation

parent 56ef7949
......@@ -1387,80 +1387,10 @@ var priv = {};
// form = document.getElementById(e.target.getAttribute("data-form"));
// target = e.target.href;
//
// e.preventDefault();
//
// if (util.testForClass(form.className), "validate") {
// valid = $(form).triggerHandler( "submitForm" );
// } else {
// valid = $(form).serialize();
// }
//
// // // TODO: how to update status?
// // if (valid !== false) {
// // jIO.util.ajax({
// // "url": "data/" + attachment + ".json", "dataType":"json"
// // })
// // }
// //
// // target = e.target.href,
// // id = form.id,
// // pointer = "response:" + id,
// // proceed = function (data, target) {
// // // changePage with fragment_cache pointer
// // $.mobile.changePage(target, {"transition": "slide", "data": data});
// // };
// //
// // // stop
// // // fetch and proceed
// // if (valid !== false) {
// // $.ajax({
// // "type":"POST",
// // "url": "foo.php",
// // "data": valid
// // }).done(function(data) {
// // // overwrite cache
// // // NOTE: FAKE data until working
// // priv.fragment_cache[id] = priv.getFakeRecords["payment"];
// // proceed(pointer, target);
// // }).fail(function(jqXHR) {
// // // fake it
// // priv.fragment_cache[id] = priv.getFakeRecords["payment"];
// // proceed(pointer, target);
// // });
// // }
// // });
// // }
// // });
// PAGE BINDINGS
.end()
// form validation initializer
.find("form")
// .filter(function () {
// return this.getAttribute("data-bound") !== true;
// })
// .each(function (i, element) {
// element.setAttribute("data-bound", true);
// // TODO: how to add custom validations here?
// // TODO: async?
// $(element).validVal({
// validate: {
// onKeyup: "valid",
// onBlur: "valid"
// },
// form: {
// onInvalid: function() { return;}
// }
// });
// })
// .end()
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment