Custom Script with Condition

I have created a Custom Field in Customer Form with ‘SELECT’ field and with values Distributor,Reseller and Enduser options.How I can list Customer Names based on the selection fields,if i select the Reseller option in SELECT field in other form like Opportunity form it will brings only the Reseller in Customer field?

There is already the Customer Group field, why not just use that?

Thanks for your reply.I have added Distributor,Reseller and Enduser in Customer Group.How I can list Customers in Opportunity form based on the value selected for Customer Group.For example if I am selecting Distributor from Customer group,then Customer should display Distributor Customers only.

I don’t think this is possible as of now, I think this is already added as an Issue recently.

https://github.com/frappe/erpnext/issues/2525