Voters said among their main motivations was finding a candidate to defeat US President Trump in the general election.