Welcome Guest, Not a member yet? Register   Sign In
modal forms with codeigniter
#1

hi guys, can someone please help me by explaining how modal forms work in codeigniter and how i can implement them with or without having to use ajax, thats if its even possible. And also how to process these form data from the modals. Thank you
Reply
#2

(This post was last modified: 05-17-2016, 08:18 AM by PaulD. Edit Reason: typo )

A modal is just a css effect run on an initially hidden div by a javascript routine. You can put a form in a modal window, of course, but you will need it to submit via ajax, and on success, switch the modal window to closed. Processing form data from a modal is exactly the same as a non modal form, it is just a form.

Doing it without ajax would mean reloading the page but this time with the modal open, not closed as it normally is. Then the form in the modal will display error messages etc.

Modals themselves have nothing to do with CI.

Paul.
Reply
#3

i do some like this:

button click:
-> call light box
-> ajax call conroller url: "controller/load_form" -> in controloer load_form () { return $this->load->view("templates/my_form"); }
-> $ajax.done(response) { $(#target_form).append(response) }

you can add animations before send "animation_loader" , succes or donde remove animation or your #target opacity : 0 and after done and and response is embeded opacity: 1 etc etc...
Reply
#4

can I get a practical example please just to fully get an idea of what you guys are explaining. Say, you want to login a user into a site using a modal login form, how do you go about it?
Reply
#5

(05-19-2016, 08:21 PM)un1txt Wrote: i do some like this:

button click:
-> call light box
 -> ajax call conroller url: "controller/load_form" -> in controloer load_form () { return $this->load->view("templates/my_form"); }
   -> $ajax.done(response) { $(#target_form).append(response) }

you can add animations before send "animation_loader" , succes or donde remove animation or your #target opacity : 0 and after done and and response is embeded opacity: 1 etc etc...

can i get a practical example please just to get an idea of what you guys are explaining. Say you want to create a modal login form looks into the database to see if a user exists and logs him/her in.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB