A se non lo avessi notato alla select viene aggiunto il campo inserito inline....oltre che registrarlo nel DB...
queste chiamate usano Ajax via Jquery ma se vuoi ti posto un esempio senza Jquery... solo chiamata XMLTTTP... fatta in un altro programma cosi puoi decidere come fare
questo script è piu vecchio ma usa la stessa tecnologia su un altro programma naturalmente...
CIAO BUON LAVOROcodice:... function RegistraProfessione(txt) { var datiform="professione="+escape(txt); datiform = datiform + "&finecampi=1"; if (window.XMLHttpRequest) { update_record = new XMLHttpRequest(); update_record.onreadystatechange = ElaboraRisposta; update_record.open("GET","InsProfessione.asp?"+datiform, true); update_record.send(null); // branch for IE/Windows ActiveX version } else if (window.ActiveXObject) { update_record= new ActiveXObject("Microsoft.XMLHTTP"); if (update_record) { update_record.onreadystatechange = ElaboraRisposta; update_record.open("GET","InsProfessione.asp?"+datiform, true); update_record.send(); } } var x=document.getElementById("professione"); var option=document.createElement("option"); option.text=txt; try { // for IE earlier than version 8 x.add(option,x.options[null]); } catch (e) { x.add(option,null); } } function ElaboraRisposta() { var risposta; if (update_record.readyState == 4) { risposta=update_record.responseText; document.<%=formname%>.msg.value = risposta; } }

Rispondi quotando