default:
item = $("<input/>");
}
+ item.addClass("df-item");
if ($(this).find("value")) {
var value = null;
if ((type == "text-multi") || (type == "jid-multi")) {
$(elem).append(form);
}
+function serializeToDataform(form, st) {
+ st.c("x", {"xmlns":"jabber:x:data", "type": "submit"});
+ $(form).find(".df-item").each(function(){
+ st.c("field", {"var": $(this).attr("name")});
+ if(this.nodeName.toLowerCase() == "select" && this.multiple) {
+ for(var i = 0; i < this.options.length; i++)
+ if(options[i].selected)
+ st.c("value").text(options[i]).up();
+ } else if(this.nodeName.toLowerCase() == "textarea") {
+ var sp_value = this.value.split(/\r\n?|\r/g);
+ for(var i = 0; i < sp_value.length; i++)
+ st.c("value").text(sp_value[i]).up();
+ } else {
+ // if this has value then
+ st.c("value").text($(this).val()).up();
+ }
+ st.up();
+ });
+ st.up();
+}
+
function displayResult(result) {
var status = $(result).find("command").attr("status");