Salve a tutti. Ho un piccolo problema sui cui mi sto incaponendo da alcuni giorni.
In pratica ho un form con una serie di input text e delle text area. Vi posto il codice del form:
Tramite una funzione Jquery passo i dati del form a una servlet che poi andrà a fare degli update su db. Fin qui tutto funzionante. Tutti i vari campi vengono tranquillamente modificati senza problemi.codice:<form class="form-container" id="upgradeInfoForm" action="" method="post"> <div class="form-title"><h2>Sign up</h2></div> <div class="form-title">Role</div> <div class="styled-select"> <select name="role" id="role"> <option value="BC Student">BC Student</option> <option value="MS Student">MS Student</option> <option value="Ph Student">Ph Student</option> <option value="Post-Doc">Post Doc</option> <option value="Assistant Professor">Assistant Professor</option> <option value="Associate Professor">Associate Professor</option> <option value="Full Professor">Full Professor</option> </select> </div> <div class="form-title">Fax</div> <input class="form-field" type="text" name="fax" id="fax" value="<jsp:getProperty name="researcher" property="fax"/>" /> <div class="form-title">Phone</div> <input class="form-field" type="text" name="phone" id="phone" value="<jsp:getProperty name="researcher" property="phone"/>" /> <div class="form-title">E-Mail</div> <input class="form-field" type="text" name="email" id="email" value="<jsp:getProperty name="researcher" property="email"/>" /> <div class="form-title">Address</div> <input class="form-field" type="text" name="address" id="address" value="<jsp:getProperty name="researcher" property="address"/>" /> <div class="form-title">University</div> <input class="form-field" type="text" name="university" id="university" value="<jsp:getProperty name="researcher" property="university"/>" /> <div class="form-title">Department</div> <input class="form-field" type="text" name="department" id="department" value="<jsp:getProperty name="researcher" property="department"/>" /> <div class="form-title">Bio</div> <textarea id="bio" name="bio" style="width: 480px; height: 200px"> <jsp:getProperty name="researcher" property="bio"/></textarea> <div class="form-title">Announcements</div> <textarea name="announcements" id="announcements" style="width: 480px; height: 200px"> </textarea> <div class="submit-container"> <input class="submit-button" type="submit" name="submit" value="Submit" /> </div> </form>
Il casino nasce quando inserisco un editor WYSIWYG per le textarea (voglio potervi inserire dell'html editabile). Ho provato con diversi editor, da NicEdit e TinyMce ma apparentemente i campi delle textarea non si vanno più a modificare (mentre tutti gli altri text input si).
La cosa strana è che se faccio un form con solamente una textarea modificata dall'editor WYSIWYG l'update funziona.
Qualcuno è in grado di darmi qualche dritta e/o farmi capire da che parte sto sbagliando?
Posto anche il codice dello script per completezza.
Grazie a tutti.
codice:/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * To change this template, choose Tools | Templates * and open the template in the editor. */ $(document).ready(function() { //var contextPath = "${request.contextPath}"; $("#upgradeInfoForm").submit(function() { //return false; var role=$('#role').val(); var fax=$('#fax').val(); var phone=$('#phone').val(); var email=$('#email').val(); var address=$('#address').val(); var university=$('#university').val(); var department=$('#department').val(); var bio=$('#bio').val(); var announcements=$('#announcements').val(); var codice ="testProva"; $.ajax({ url: 'http://localhost:8080/WebApplication1/UpdateController?'+codice , data: { role:role, fax:fax, phone:phone, email:email, address:address, university:university, department:department, bio:bio, announcements:announcements }, type: 'post', success: function(msg) { if (msg == 'VALID') { /* $("#updradeInfoForm").fadeOut("fast", function() { $(this).before("Operazione riuscita con successo"); setTimeout("$fancybox.close()", 2000); window.location.reload(); });*/ document.location.href="http://localhost:8080/WebApplication1/BackEndServlet?home"; } else { $("#message").html("Some error"); } } }); return false; }); });//document

Rispondi quotando