fj1200 Posted July 6, 2009 Share Posted July 6, 2009 Hi - I am building a form to update records in a database but struggling a bit with one secondary but vitally important area. I wrote the data entry for using drop-down lists where the value is not the same as the list entry - for example, I have material widths where they are represented in the database as: 1/2 = 0, 3/4 = 1 and full width = 2. There's 10 of these. I have a machine number where A = 101, B=102, D=103, E=104 - this is how they are represented in the manufacturers DB and I'm following their naming for continuity and reporting. I want to update these on the fly, so if, for example machine D is entered in the database, how do I set the "selected = ..." value in the drop-down on the form to reflect the database entry? eg. <Select> <option Value = \"101\">A</option> <option Value = \"201\">B</option> <option selected = \"selected\" Value = \"301\">D</option> <--- like this... <option Value = \"401\">E</option> </select> I only need to update maybe a few items - maybe we change the scheduled time, or put a job on a different machine, or the order changes - that kind of thing. I don't want them to have to re-enter the whole job so there's a fair number of these to do on the update page. Been tearing my hair out and could do with some advice. Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.