Topic: Change form multipart not using ajax

Hello,

I notice that ordinary form and multipart form (for uploading file) works differently. Ordinary form will use normal http request while multipart form use ajax. It is indicated by the url. Ordinary form change the url (if there are get variable, it will be disappear) but in multipart form it doesn't change.

This behavior cause the javascript I made that is placed after submit process is not executed. Is there any way to fix this?

I think best solution is deactivate ajax processing for multipart form.

Re: Change form multipart not using ajax

Here is the function

 start_form 

.

function start_form($multi=false, $dummy=false, $action="", $name="")
{
    // $dummy - leaved for compatibility with 2.0 API
    global $form_nested;

    if (++$form_nested) return;

    if ($name != "")
        $name = "name='$name'";
    if ($action == "")
        $action = $_SERVER['PHP_SELF'];

    if ($multi)
        echo "<form enctype='multipart/form-data' method='post' action='$action' $name>\n";
    else
        echo "<form method='post' action='$action' $name>\n";

}

You need to add an extra parameter and write this function on your specific need. But i think that ajax processing and ordinary form submit can be defined on the submit button function.Try  glance the

 submit

function to know more

Subscription service based on FA
HRM CRM POS batch Themes

Re: Change form multipart not using ajax

To make the $_GET variables persistent, copy it to the session variable.