Welcome Guest, Not a member yet? Register   Sign In
CI2, jQuery and creating inputs onfly
#1

[eluser]Ficoder[/eluser]
Hi,
I started my new project with CI2.0 and i have been struggling with this problem a while. So i have one view and it contains form what has been made with CI form helpers. One field is problematic cause i can't know advance how many text inputs user needs. So my friend jQuery came to help and i made button witch adds new input when its pressed.

Problem is that when page gets refreshed == submitted, all those jQuery added text inputs gets disappeared. How do i handle this situation that after view call's controller -> notices that there is errors -> calls again that view, shows errors and would show all those user added fields too and their values.

One thing is sure, that there will be always one hard coded text input for that reason. Second question to this same problem is that what kind of naming i should use to those inputs. Should i name hardcoded and all jQuery made inputs with [] suffix, so those all would be in one array?




Theme © iAndrew 2016 - Forum software by © MyBB