[eluser]benmanson[/eluser]
[quote author="jedd" date="1236758428"]
You know that there's a [url="http://ellislab.com/codeigniter/user-guide/helpers/form_helper.html"]form helper[/url], don't you? You shouldn't need to do manual <input> tags. Plus I'm guessing poslist needs a $ in front of it .. ?
Post some code, if you'd like comments. I used a hidden field approach for my forms .. I can post, but it's pretty lengthy and quite custom.[/quote]
Thanks jedd,
Apologies if I have caused confusion. The code I posted was the resulting html, not the php to create it. I posted it as an example of what i am trying to achieve. I am OK with using the form helper, creating hidden fields etc.
I will try to explain a bit better.
As an example, I have a list of projects:
Project 1
Project 2
Project 3
Project 4
I want to allow the CMS user to change the order those projects appear on the website. I have created a column in the dbase projects table called 'pos'. By setting a pos for each project, I can then orderby that 'pos' when outputting the projects.
So to order the projects like:
Project 4
Project 2
Project 1
Project 3
The user would assign a value to the 'pos' field for each one.
Rather than having to edit the 'pos' for each project individually, I want to display a list of all the projects on the page and the form field 'pos' for each one (As per screengrab in first post).
I am not sure how to do that. I will also need the 'id' for each project so when I update the dbase I can match the 'pos' to the project.
So I am guessing I need to end up with an array like
row | id | pos
---------------
[1] | 13 | 10
[2] | 12 | 30
[3] | 15 | 20
...
But I am not sure how to do it correctly. Does that help explain? Maybe I am going about it the wrong way entirely - if anyone can set me straight I would appreciate it.
cheers
Ben