submit(url[, encType])

Submit data by POST method to the specific page.

Syntax

Parameters

url
Type: string
A page url to be redirected to.
encType
Type: string
Encoding type.

Examples

<input id="c" type="text" value="5" />
<input id="uploader" type="file"/>
<script>
    var data = {
        a: 1,
        b: 3,
        c: document.getElementById("c"),
        file: document.getElementById("uploader")
    };
    $from(data).submit("/test.php");
</script>

This code will redirect the page to '/test.php' with POST data 'a=1&b=3&c=5&file=(file data)".

Last edited May 18, 2012 at 2:19 PM by suckgamoni, version 1

Comments

No comments yet.