Announcement

Collapse
No announcement yet.

AjaxPost question

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

    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?

    Cheers,
    Bob
    Web site | Help Desk | Feature Requests | Message Board

    #2
    I was missing the name attribute for the <select> tags
    Cheers,
    Bob
    Web site | Help Desk | Feature Requests | Message Board

    Comment

    Working...
    X