A method of preparing a mucoadhesive film containing vardenafil or a pharmaceutically acceptable salt of vardenafil, by admixing, in an aqueous liquid carrier, vardenafil or a pharmaceutically acceptable salt of vardenafil, a C3-C12 polyol, and a pH regulating agent, to obtain a liquid composition having a pH of at least 4.2; admixing the liquid composition with analginate salt of monovalent cation or a mixture of such salts, distributing the obtained composition onto a solid surface; and permitting the composition to dry. A mucoadhesive film containing vardenafil or a pharmaceutically acceptable salt of vardenafil, its use for treating sexual dysfunction.