salve gente vi posto del codice per potermi dare una mano, lo script ha funzionato fino a qualche tempo fa ma ora niente più...
questo invece è il form dalla quale prendo il testo:codice:function check_oggetto() { if (document.getElementById("oggetto").value == "a") document.getElementById("categoria").disabled = false; else document.getElementById("categoria").disabled = true; } function check_form(page) { if (document.getElementById("oggetto").value == "null") { alert("Attenzione!!! Seleziona l'azione che si vuole fare"); return false } if (document.getElementById("oggetto").value == "a" && document.getElementById("categoria").value == "null") { alert("Attenzione!!! Selezionare dove pubblicare l'articolo"); return false } if (document.getElementById("oggetto").value == "n") { if (confirm ("Attenzione!!! Stai per inviare una Newsletter Vuoi continuare?")) { document.getElementById("editor").action = "addNewsletter.php"; document.getElementById("editor").submit(); } else { return false } if (document.getElementById("oggetto").value == "a" && document.getElementById("categoria").value != "null") { var cat = ""; switch(document.getElementById("categoria").value) { case "nv": cat = "Novità"; break; case "d": cat = "Dramaterapia"; break; case "l": cat = "Laboratori"; break; case "cf": cat = "Corsi di Formazione"; break; case "pi": cat = "Percorsi Individuali"; break; case "sr": cat = "Spettacoli in Replica"; break; } if (confirm ("Attenzione!!!\nStai per pubblicare un articolo in "+cat+"\nVuoi continuare?")) { document.getElementById("editor").action = "save.php"; document.getElementById("editor").submit(); return true } if (page=='prew') { document.getElementById("editor").action = "template.php?page=prew"; document.getElementById("editor").submit(); return true } else { return false } } } }
hai voglia a schiacciare invia a e prew non succede nulla, ah p.s. l'editor del form si chiama ckeditor...codice:<form name="editor" id="editor" action="#" method="post"> <div align="center"> <textarea name="editor1" style="overflow:hidden"></textarea> <script type="text/javascript">CKEDITOR.replace( 'editor1',{filebrowserUploadUrl : 'upload.php'}); </script> <select name="oggetto" id="oggetto" onchange="check_oggetto();"> <option value="null">--- Scegli cosa vuoi fare ---</option> <option value="a">Pubblicare Articolo</option> <option value="n">Inviare Newsletter</option> </select> <select name="categoria" id="categoria"> <option value="null">--- Scegli dove pubblicare l'articolo ---</option> <option value="nv">NovitÀ</option> <option value="d">Dramaterapia</option> <option value="l">Laboratori</option> <option value="cf">Corsi di Formazione</option> <option value="pi">Percorsi Individuali</option> <option value="sr">Spettacoli in Replica</option> </select> <input type="button" value="Invia" onclick="check_form('pub');"> <input type="button" value="Prew" onclick="check_form('prew');"> </form>

