No, grapefruit-san's clarification is correct.
There's another requirement when ために can be used.
Both of the subjects of the main clause and the subordinate clause must be the same one.
(私は)日本に行くために、お金を貯めた。
(わたしは)にほんにいくために、おかねをためた。
I saved money to go to Japan.
"にほんにいく; Go to Japan" is the subject's (the speaker's) volitional act, and the person who saved the money is also the speaker.
On the other hand, ように can be used when the both subjects are different.
水が流れるように、溝を掘った。
みずがながれるように、みぞをほった。
I dug a ditch so that the water ran off.
In the sentence above, the subject of the subordinate clause 水 is different to the one of the main clause "I, the speaker."
水を流すために、(私は)溝を掘った。
みずをながすために、(わたしは)みぞをほった。
In this case, the person who ran the water and dug a ditch are same, "the speaker." So ために can be used.
Also, ように often used with possible verbs.
日本に行けるように、(私は)お金を貯めている。
にほんにいけるように、(わたしは)おかねをためている。
I'm saving money so that I can go to Japan.
妹が大学に行けるように、彼は懸命に働いている。
いもうとがだいがくにいけるように、かれはけんめいにはたらいている。
He is working hard so that his sister can go to college.
のに is used only with a type of verbs/adjectives in the main clause.
かかる・要[い]る・大切[たいせつ]だ・便利[べんり]だ・役[やく]に立[た]つ・いい・使[つか]う・利用[りよう]する・苦労[くろう]する...
日本に行くのに、お金が要る。
にほんにいくのに、おかねがいる。
I need money to go to Japan.
These verbs/adjectives are used with the particle に when the object is the noun too.
旅行にお金が要る。
りょこうにおかねがいる。
I need money for the travel.
This のに is considerd as "the nominalizer の + the particle に."
hope this helps