Polish leader Stanislaw Kania today received a resounding vote of confidence from rank-and-file Communists when he was elected as a delegate to next month's emergency Communist Party congress.

Kania's election as a delegate by the party organization in the southern city of Krakow marked the first stage in his attempts to be reelected as party leader. It also strengthened his position within the party following an open challenge last week by hardliners on the policy-making Central Committee.

The election campaign in Krakow, one of 49 provinces in Poland, reflected a new phenomenon for a Communist country. For the first time, Communist leaders are having to run for office in elections by secret ballot with a genuine choice of candidates.

Kania, who is regarded as a moderate in Polish political terms, was elected by 365 out of 396 votes cast in the Krakow election. Also chosen as a delegate in the same election was the deputy premier responsible for negotiations with the independent trade union federation Solidarity, Mieczyslaw Rakowski.

So far only one quarter of the 2,000 delegates to the congress have been elected, with the rest to be chosen during the next two weeks. Much interest centers on whether hard-liners within the present leadership will be chosen as delegates to represent the party's 3 million members. To fail at this hurdle could mean the end of their political careers.

A new Central Committee, Politburo and Secretariat will be elected at the congress. The democratic election procedures, combined with the prospect of new faces, has clearly alarmed the Kremlin since it involves a radical departure from the Soviet model of a party rigidly controlled from the top.

Polish political analysts believe that as many as two-thirds of the present leadership could fail to win reelection to the Politburo and Central Committee.

Parallel with the election campaign in the Communist Party has been a similar campaign in Solidarity, which claims 10 million members. Electrions are under way for the regional authorities of the union leading up to Solidarity's first national congress in September.

In both the party and Solidarity, election meetings sometimes last for more than 24 hours. Numerous points of order are raised and there are frequently heated debates about election procedures.

"We still have to learn democracy. At present it's as if we're intoxicated with it after so many years of forced abstinence. Everybody wants to get his own views across and are sometimes intolerant of others," commented one party member.

Under the old system, elections within the party were fixed in advance. The party leaders decided who should be elected to the congress, after some bargaining with each other, and ordinary party members were presented with a list of delegates to select. The choice was confirmed by an open show of hands at boring election meetings.

Today it is virtually impossible to manipulate the elections, although the party leaders still have a certain advantage over the rank-and-file. Rather than starting off right from the bottom at factory level, they can choose to run for election at a provincial conference where their chances are better. This is what Kania did in Krakow.

Even at provincial level, however, they are by no means certain of being elected. Communist Party activists in Krakow said that, of the present 11-member Politburo, only Kania and the prime minister, Gen. Wojciech Jaruzelski, stood a reasonable chance in the province.

Addressing the Central Committee last week, Kania appealed to local party organizations to elect members of the central leadership as delegates to the congress for the sake of continuity.