Run 2 submits with Editor

Run 2 submits with Editor

randynewsrandynews Posts: 1Questions: 1Answers: 0

A simplified example of what I'm trying to do with Editor:

$('#table tbody').on('click','tr',function() {
    editor.set('description','test').submit();
    editor.set('location','test').submit();
});

Shouldn't this set both 'description' and 'location' to test? The first submit fires successfully. The second submit does not return either success or error. It simply does not seem to do anything.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,831Questions: 1Answers: 10,518 Site admin
    Answer ✓

    Editor can only submit one form at a time, and if you are using Ajax for the submit, then they are likely to overlap and conflict with the above. Instead us:

    $('#table tbody').on('click','tr',function() {
        editor.set('description','test');
        editor.set('location','test').submit();
    });
    

    Or:

    $('#table tbody').on('click','tr',function() {
        editor
            .set('description','test')
            .set('location','test')
            .submit();
    });
    

    I don't see a call to edit() in the above code, so Editor probably isn't editing anything, unless you've called that somewhere else?

    Allan

This discussion has been closed.