+
+/**
+ * function: $.fn.formValues
+ * usage: $('#frmLogin').formValues()
+ * docs: Gets the form values and creates a key=>value array of the found values (only for ENABLED elements!)
+ */
+$.fn.formValues = function() {
+ var a = [];
+ this.find("input[@type='submit'],input[@type='hidden'],textarea,input[@checked],input[@type='password'],input[@type='text'],option[@selected]").filter(":enabled").each(function() {
+ o = {};
+ o.name = this.name || this.id || this.parentNode.name || this.parentNode.id;
+ o.value = this.value;
+ a.push(o);
+ });
+ return a;
+};
+
+/**
+ * function: $.update
+ * usage: $.update('someJQueryObject', 'someurl', 'array');
+ * docs: Mimics the ajaxUpdater from prototype. Posts the key=>value array to the url and
+ * puts the results from that call in the jQuery object specified.
+ * --> If you set the blnNoEval to true, the script tags are NOT evaluated.
+ */
+$.update = function(objElement, strURL, arrValues, fncCallback) {
+ $.post(strURL, arrValues, function(strHTML) {
+ //
+ // Update the element with the new HTML
+ objElement.html(strHTML);
+
+ //
+ // Evaluate the scripts
+ objElement.html(strHTML).find("script").each(function(){
+ try { eval( this.text || this.textContent || this.innerHTML ); } catch(e){}
+ });
+
+ //
+ // Callback handler
+ if (fncCallback) { fncCallback(); }
+ });
+};