Jump to content

My function to set the selected option not working


KateMacwil

Recommended Posts

Hi

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.

 

tender-functions.php

tenders-update.php

screenshot-of-issue.png

Link to comment
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
×
×
  • Create New...