Jump to content

My function to set the selected option not working

Recommended Posts


I have created a file called tenders-update.php which allows the user to update an existing record.
One of the fields (a select element called "type") is on this page.
I have defined an array of available options for the type as follows:

   $options = array ('Construction' => 'Construction',  'Goods' => 'Goods',  'Services' => 'Services');

I have also written a function which takes the $options array and the $type variable:

MakeTypeOpts($options, $type)

When I run this page, the select list contains the contents of the $options variable over and over and the $type variable is not selected.
I am trying to figure out what I'm doing wrong here.





Share this post

Link to post
Share on other sites

I don't see anything in that code which would cause that, but you can have it print out the array of options or other things to verify what it's doing.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now