views:

15

answers:

0

Hi all!

I have a list of exercises which I want to edit using form inside Jquery-ui dialog.

I initialize dialog on page ready:

$('#exercise-edit').dialog({autoOpen:false});

Then on each exercise click I do ajax call and it fetches exercise data and populates it using "populate" plugin

function showEditExercisePopup(id){

    $.getJSON(baseUrl + 'json/exerciseinfo', {id : id}, function(json){
        $('#exercise-edit form')[0].reset();
        $('#exercise-edit form').populate(json[0]);
        alert($('#exercise-edit form input[name="title"]').val());

        $('#exercise-edit').dialog('option','title', 'Edit exercise'); 
        $('#exercise-edit').dialog('open');
        alert($('#exercise-edit form input[name="title"]').val());
    });
}

Normally everything works fine but after clicking on some exercises with long titles like "Barbell Incline Bench Press - Medium Grip" title doesn't change across different exercises. Other fields get populated correctly.

I placed alerts to check what current value of title field is - when I ajax is done it's populated correctly showing current exercise, but after .dialog('open') title goes back to exercise with long name - it kinda sticks there.

If I don't show dialog both alerts show the same correct value.

So, does Firefox have some kind of caching mechanism for long form fields values? And more importantly - how can I fix this?

I'm using Firefox 4.0 beta 5 Linux