I have a JavaScript that changes the attribute of the input button to "disabled", so the user don't submit the page twice.

```
// Disables multiple submit
function disableSubmit (btn, submitForm) {
    // Sets button as disabled, changes class and cursor
    $(btn).attr("disabled", true);
    $(btn).toggleClass("disabled alt2");
    $(btn).css('cursor', 'initial');
    $(btn).attr("value", "Sender...");
    // Submits form
    $(submitForm).submit();
}

// Disables submit for order form
$("#send-order").click(function () {
    return disableSubmit(this, "#order");
});

```

The problem is that I need to track the name of the button submitting the page so I can handle it in my Django `view.py` file.

HTML
====

```
<input value="Send bestilling" id="foo" name="send-order" type="submit" class="button alt2">

```

View.py
=======

```
request.POST.get("send-order", False)

```

But if I use my script to submit the page, I can't get the name of the input submitting the page. Is there any way to set a name for the button submitting the page in my script?

I tried this but didn't work:

```
$(submitForm).submit().attr("name", "send-order");

```

Solution
========

I had to change the code inside `views.py` in order to make this work.