  Using the Sen's entropy function formalism, we compute the entropy for the
extremal dyonic black hole solutions of theories in the presence of dilaton
field coupled to the field strength and a dilaton potential. We solve the
attractor equations analytically and determine the near horizon metric, the
value of the scalar fields and the electric field on the horizon, and
consequently the entropy of these black holes. The attractor mechanism plays a
very important role for these systems, and after studying the simplest systems
involving dilaton fields, we propose a general ansatz for the value of the
scalar field on the horizon, which allows us to solve the attractor equations
for gauged supergravity theories in $AdS_4$ spaces. In particular, we derive an
expression for the dyonic black hole entropy for the $\mathcal{N}=8$ gauged
supergravity in 4 dimensions which does not contain explicitly the gauge
parameter of the potential.
