From 1236f23f9e02d4b0907cd3f7dc8958abe012cc4e Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 16 Jan 2014 23:54:19 -0600 Subject: [PATCH] form methods. --- lib/widget.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/widget.js b/lib/widget.js index d128441..a36afa7 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -4444,6 +4444,20 @@ Form.prototype.focusPrevious = function() { this.previous().focus(); }; +Form.prototype.resetSelected = function() { + this._selected = null; +}; + +Form.prototype.focusFirst = function() { + this.resetSelected(); + this.next().focus(); +}; + +Form.prototype.focusLast = function() { + this.resetSelected(); + this.previous().focus(); +}; + Form.prototype.submit = function() { var self = this , out = {};