Basically, I have a hidden field I set using
$form['slideid'] = array( '#type' => 'hidden', '#value' => arg(2) ); $form['fid'] = array( '#type' => 'managed_file', '#title' => t('Image'), '#default_value' => "", '#size' => 40, '#description' => t("Image should be less than xxxxxxxxxxxx."), '#upload_location' => 'public://', '#prefix' => '<div id="things">', '#suffix' => '</div>', );
This value is set correctly once the form loads, but after a call to a AJAX field (managed_file), the form is refreshed and I get the wrong value in
I have found arg(1) changed when doing AJAX, which doesn't give me any solution.
Is there any alternative that can be used, or can we skip the hidden field in the AJAX re-build? Is it possible to use a managed_file element without the AJAX submit?