jQuery modal, and forms |
[eluser]the_unforgiven[/eluser]
Hi All, I have a small issue, i have a link which pulls up a modal box for people to login but i need to know how to show the validation_errors() function with that modal and also how to submit the form without it going to a function within my controller. Can anyone advise please. Heres my code: Code: Link: <li><a href="#login" role="button" data-toggle="modal">Login</a></li> which opens the jquery modal with this inside: Code: Controller Thanks in advance..
[eluser]skunkbad[/eluser]
You're going to have to submit the form via ajax, so you're going to have to send a request to a controller or a php script of some kind. It is there in that controller/method or script that you will do your form validation and determine the success of the login attempt. You will send back your ajax response from the server to the client including all of those details. What you do with the response is up to you. This is pretty simple stuff. Once you do it you will be amazed at how easy it is.
[eluser]the_unforgiven[/eluser]
Gracias, appreciate the in depth answer thank you!
[eluser]the_unforgiven[/eluser]
OK, i have done this ajax request, Code: $(function() { Code: if($this->form_validation->run() == TRUE) { submit to db } If someone can help I'd be greatly apprecative with many thanks.
[eluser]the_unforgiven[/eluser]
Heres my modal code for the login form http://d.pr/i/PpBc Here's the controller: http://d.pr/i/bV1u The ajax magic: http://d.pr/i/lAb1 But still i cant get it to show errors with the box modal popbox and also want it login like it would do within a normal page anyone have any idea's? I pasted to droplr for ease of use!
|
Welcome Guest, Not a member yet? Register Sign In |