Welcome Guest, Not a member yet? Register   Sign In
And simultaneously how don't lose entered information?
#1

I want to make different controllers to show form and validate form, but at the same time i want to be able to show a validation message.
So for instance i  want to have a log in form two different places 
1) special page: site/login
2) anywhere on the site in the right top corner of the page 

And i want to share validation logic between them.
So i want two this forms send data on the same controller 
POST - user/validate
And at the same time if password is incorrect (or something else) show a validation error (in different places).


And second part of my question is How can i implement forms with validation on the one page.
Let's imagine a situation.

It's something like a forum - and i have 3 forms on one page -
1) mini login in the right top corner of the page.
2) main form for submitting your post
3) additional post for commenting system

And i wanna validate data from those forms (of course on the different controllers to avoid code duplication) and show validation error on the needed form (so if the password is wrong show it near the form, when you can write a password in, and on the form where you writing a commentary). 
Reply
#2

1) You can give each form it's own html id value.

2) place your validation rules in your model or validation file.

Using the form id you can target which form you need to get or send info to.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB