This is what I did. It's kind of ugly, but that's the only thing I could make work :
# We use evaluate and not fill because of one stupid multipleselect
@evaluate (data, store_ids) ->
document.querySelector('input[name="title"]').value = data['title']
document.querySelector('input[name="url"]').value = data['url']
document.querySelector('textarea[name="content"]').value = data['content']
# Store ids multiple select
options = document.querySelectorAll("#page_store_id option")
# Deselect all values
i = 0; len = options.length
while i < len
options[i].selected = false
i++
# Select the one we want
j = 0; len1 = store_ids.length
while j < len1
document.querySelector('#page_store_id option[value="'+store_ids[j]+'"]').selected = true
j++
# Submit form
editForm.submit();
, data : data, store_ids : store_ids
So, for the explanation : I used evaluate instead of fill for fill my form. Filling half of it using @fill and the other half using @evaluate didn't work, that's why is do things like :
document.querySelector('input[name="title"]').value = data['title']
document.querySelector('input[name="url"]').value = data['url']
document.querySelector('textarea[name="content"]').value = data['content']
As for the next part of the code, it's already documented : first you need to deselect every option, and then select the one that you want. I'm sure it can be done in a nicer way but I'm not a coffee expert (nor a javascript !)
Anyway, I hope that helps !