Any person desiring to become a candidate in any regular election shall file written notice of his candidacy with the municipal election superintendent not less than 15 nor more than 45 days, as prescribed by ordinance, prior to the date fixed for the holding of any such election. Any person desiring to become a candidate in any special election shall file written notice of his candidacy with the municipal election superintendent not less than ten days nor more than 30 days, as prescribed by ordinance, prior to the date fixed for holding any such election.