You are partially correct , you are not passing cat id in your parameter. Try
$categories_array[ $category->term_id ] = $category->name;
Now you will get category id as drop down value.
You are partially correct , you are not passing cat id in your parameter. Try
$categories_array[ $category->term_id ] = $category->name;
Now you will get category id as drop down value.