Welcome Guest, Not a member yet? Register   Sign In
What is the best way to use a modal login form with my CodeIgniter app?
#1

[eluser]jleequeen[/eluser]
I'm currently learning Jquery and Fancybox. I would like to add a modal login form to my CodeIgniter app, but I am not sure the best way to go about this. Should I use ajax to pass the data to my controllers method? Could anyone that has done this please provide me with some thoughts or examples on this?
#2

[eluser]jleequeen[/eluser]
I'd really like some help with this. Even if you could point me to a tutorial that would be great. Thanks.
#3

[eluser]Kamarg[/eluser]
You have the right idea. When they press the submit on your modal form, use jquery's post method to send the form data to your controller. Have the controller print the status of their login attempt and handle it in the success function that the .post call uses.
#4

[eluser]jleequeen[/eluser]
[quote author="Kamarg" date="1300931672"]You have the right idea. When they press the submit on your modal form, use jquery's post method to send the form data to your controller. Have the controller print the status of their login attempt and handle it in the success function that the .post call uses.[/quote]

Do you know where a good tutorial of this is? I haven't really been able to find what I want. I've used CI for a long time, but have not tried to do modal forms with jquery or ajax before, so this is very new.
#5

[eluser]InsiteFX[/eluser]
You also need to take account of the new CSRF Protect that CI uses now!

InsiteFX
#6

[eluser]Kamarg[/eluser]
I don't know of a tutorial for doing this. It's very easy to put together after reading the documentation. Start with the jqueryui dialogpage to learn how to create a modal dialog. Then go to jquery .post function to learn how to submit your form via ajax. In your codeigniter controller send back a response that is handled by the callback function you gave to the .post command.




Theme © iAndrew 2016 - Forum software by © MyBB