jQuery AJAX - input value not set after submit (plugin)
===

I have create a jQuery plugin that creates a button (input of type "button") beside some fields (text, select, etc.) and I got it to work - but only with hardcoded options for the ajax function. This means I can set the option values (e.g. data) to the value of the input field and it will send it correctly.

I wan't to extend this plugin to be able to set custom options - using the same array - basically the function takes an object as argument, and puts it in the ajax function arguments ($.ajax)

The problem I ran into was that value of the input field was not set before the AJAX request.

This is the plugin I have written: [Click here][1]

and it's used by applying .updater() to each form field like so

    $("#username").updater();
If no arguments set or some options, it uses the defaults, set in the plugin. You will be able to use same arguments as the $.ajax function
    
    $("#username").updater({
        type: 'GET',
        url: 'ajax_update.php',
        data: 'fullname=' + $("#username").val() + '&field=' + $("#username").attr('name'),
        success: function(data) {
	        console.log(data.status + ": " + data.message + "\n\n");
        }
    });
But the `$("#username").val()` is not set when clicking the button.

Hope you can help me find a solution for this


  [1]: http://pastebin.com/P0Fs3iaY