The problem is $options['id_field'] doesn't have a value outside of the function. Is there a way I can do this?
Also I was using 'title' because this is an update form for customer details. The function fills the select box with values from another table called 'ctitle' and then 'selects' the value that matches the 'title' column in the customer details (i.e Mr, Mrs, Miss etc)
I want the user to be able to change the customer's title, but just can't work out how to post the new value if they select a new one?
Perhaps I'm approaching it in the wrong way?
(I'm quite new to PHP in case you hadn't noticed!)
Well, the problem is the select name is dynamic, so outside of the function you don't know what it's called. So i think you have 2 choices.
1. Prefix the select name with a common prefix, like 'sel_<whatever>' then you can check the posted keys to see if it begins with sel_
2. Used a fixed select name.
I'd go for option 2 Any fields/values you need to do the form processing (other than those displayed) i'd just put it hidden form fields. Without seeing the full code this is as far as my thinking takes me, but i hope it makes some sorta sense