F2 visa holders eligibiity of study in a 100% online university


this is my first post at this forum. okay here is my situation. I am a F2 visa holder in USA. is it possible for to me to study at a 100% online university in USA?? Colorado state university-global campus is a 100% online university at which I am thinkin of applying for my bachelors. I have already talked to the student advisor there. she told me the degrees can be pursued entirely online and even anywhere from the world.

if I do enroll in such a university does that mean I am violating the law as f2 visa holders cant study.

please help me with your knowledge and if anyone has any official information on this matter please share link. tnxx in advance.