I have weird problem with my code. I have form with few fields. If user selects a checkbox i want that other fields disappear and new fieldset with file upload appear. This works great except that when I choose file to upload and press submit, nothing happens. I think it's something wrong with ajax callback, because when I remove that callback (ajax_classes_from_file_callback) file upload works. This code bellow is from my tests. It has the same problem. Maybe i need to set something in $form_state?
<?php
function insert_class_form($form, &$form_state){
$form['insert_class'] = array(
'#type' => 'fieldset',
'#title' => t('Insert new class'),
'#weight' => 0,
);
$form['insert_class']['table'] = array(
'#prefix' => "
",
'#suffix' => "
",
'#weight' => 1,
if(empty($form_state['values']['fromfile']) || $form_state['values']['fromfile'] != 1){
$form['insert_class']['table']['class_name'] = array(
'#type' => 'textfield',
'#required' => TRUE,
'#maxlength' => 4,
'#title' => t('Class name'),
'#prefix' => '