I'm building a back end for a website that will let the owner (a joiner) control the previous jobs he wants to showcase on his site. Pretty simple mostly but one issue is stumping me at the moment....
I have a page where he can tweak the details of each job, including the order in which the various images of that job are displayed. At the moment it relies on him uploading each image in the order it should be displayed which is pretty poor usability!
So I have added a [sort] field to the database entry for each job picture - when he goes to the editting page for any given job, it returns all the images he has uploaded and dynamically writes a html textbox against each image - this is where I want him to be able to enter the sort priority for that image.
Where I am struggling is on how to proceed when he hits the update button to trigger the related function in the c# code page...
I have given all of these textboxes the same name - picSort - and have dynamically set the ID to the pictures id in the database. So what I have to work with so far is something that looks like this:
<img src="../images/jobsS/JOBPIC_163201260206PM.jpg" alt="" /> <br />Sort: <input style="width:50px" type="text" name="picSort" id="13" /> <img src="../images/jobsS/JOBPIC_163201260437PM.jpg" alt="" /> <br />Sort: <input style="width:50px" type="text" name="picSort" id="15" /> <img src="../images/jobsS/JOBPIC_163201260531PM.jpg" alt="" /> <br />Sort: <input style="width:50px" type="text" name="picSort" id="16" /> <img src="../images/jobsS/JOBPIC_163201260627PM.jpg" alt="" /> <br />Sort: <input style="width:50px" type="text" name="picSort" id="17" /> <img src="../images/jobsS/JOBPIC_163201260700PM.jpg" alt="" /> <br />Sort: <input style="width:50px" type="text" name="picSort" id="18" />
Essentially what I need to do is:
- Find all html texbox controls in the form with the name "picSort"
- For each of these I need to update the database entry with the id in the ID field, with the sort value that has been entered in the textbox
Thanks
Andy









