Announcement

Collapse
No announcement yet.

AjaxPost question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Blade
    replied
    I was missing the name attribute for the <select> tags

    Leave a comment:


  • Blade
    started a topic AjaxPost question

    AjaxPost question

    From what I can tell the onclick for a button does not seem to include <select> and <checkbox> values in the data it sends to the plugin
    Here is the default code that seems to only get <input> tags

    Code:
    $(document).on('click','button', {} ,function(e){
    var data;
    var butAttrs = e.target.attributes;
    var butAction = butAttrs.getNamedItem("action").value;
    if (butAction === "delete_receiver") {
    return;
    }
    $(this.attributes).each(function() {
    var parts = this.nodeName+"="+this.nodeValue;
    
    if(data==null) {
    data = parts;
    }
    else {
    data = data+"&"+parts;
    }
    });
    
    var fdata = $(this.form).serialize();
    
    if(fdata != null) {
    data = data+"&"+fdata
    }
    
    AjaxPost(data,"receivers.html");
    });
    Any ideas what I am missing?

Working...
X