AJAX questions - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: AJAX questions (/showthread.php?tid=29924) |
AJAX questions - El Forum - 04-26-2010 [eluser]Carlos Mora[/eluser] Hi ignitors, I've been learning about using AJAX with forms, using FormTorch as a base. This works fine, except for a minimal problem, that follows: There is spans between label and inputs to show eventual errors like Code: <span class="error" id="nombre_error"> Code: $("#nombre_error").html(data.nombre); That makes the error message appears, but ads the error message surrounded by a <p> as in: Code: <span class="error" id="nombre_error"> where the extra <p> came from? that changes the presentation, <p> is a block tag. AJAX questions - El Forum - 04-26-2010 [eluser]behdesign[/eluser] If the ajax data is coming from FormTorch (which I don't know) - then the formatting must be coming from there. Check to see what the output of the JSON data from FormTorch is sending, and remove the <p> tag if necessary. AJAX questions - El Forum - 04-26-2010 [eluser]Carlos Mora[/eluser] Thank you behdesign. And yes, i'm using formtoch's controller/action, Code: function process() { I forgot that "...by default, the Form Validation class adds a paragraph tag (<p> around each error message shown. You can either change these delimiters globally or individually...." Thanks again, you directed me to the solution, Regards. |