Oto rozwiązanie:
Nie da rady zrobić tego bezpośrednio formularzem, należy utworzyć dodatkowy formularz z polem hidden a następnie przy pomocy JS do value hiddena wrzucić dane z iframe
Poniżej gotowy kod, może komuś się przyda:
<a onclick="document.getElementById('iframka2').contentWindow.document.execCommand('bold', false, null);
" href="javascript:void(0)">Pogrubiony</a>
<br>
<iframe id="iframka2" onload="document.getElementById('iframka2').contentWindow.document.designMode='on';
document.getElementById('iframka2').contentWindow.document.body.innerHTML='<?php
$plik = implode('', file('index.txt'));
echo $plik;
?>'"></iframe>
<br>
<form action="index.php" method="post">
<input id="hidd" type="hidden" name="str" value="0">
<input id="zapisz" type="submit" value="Zapisz zmiany">
</form>
<script>
var save = document.getElementById("zapisz");
save.addEventListener('click', zapisz, false);
var hidden = document.getElementById("hidd");
function zapisz()
{
hidden.value = document.getElementById('iframka2').contentWindow.document.body.innerHTML;
}
</script>
Pozdrawiam