I actually have some first-hand experience with this.
Short answer--yes. Yes, you can have your child committed against their will (and sometimes a spouse), if you have a physician agree with your assessment that they are a danger to themselves or others. And yes, even in voluntary situations, often a patient's rights are removed.
If you go (or are taken) to a hospital because you say you want to kill yourself, they usually admit you into the hospital immediately, for overnight observation. If, at this point, you are still thought to be a danger to yourself or to someone else, you can be committed to the "psych ward" of the hospital or transferred into a facility that specializes in mental/emotional issues. This can and is often done without the patient's consent and the patient cannot be released until the doctor signs release papers. This is an involuntary commitment.
If you are committed to one of these types of facilities, getting a visitor is very difficult. Usually the physician in charge determines when a patient is ready to see visitors. It can be several days or weeks, it just depends.
If you decide for yourself that you might hurt yourself or hurt someone else and go a private recovery facility willingly (rather than going to the public hospital), they usually have you examined/interviewed by a psychiatrist to assess your situation. And in the cases I know of, if you are accepted into their treatment program, you give up your rights. It may depend on the facility--some may have more stringent rules than others, but the ones I know of really won't let you leave until the physician clears you. Visitation is extremely limited. You are required to attend the classes they assign, required to take the medications they prescribe. The demand for a bed in these facilities is extreme, so if they don't think you absolutely need it, they will deny you admission.
Public hospitals are not allowed to turn patients away for an inability to pay, especially in the case of suicidal or homicidal tendencies. They bill your insurance companies. If you don't have insurance, you are still sent a bill (and not paying it will hurt your credit). Admission to treatment facilities is usually dependent mostly on the severity of the threat you cause, without a lot of concern for insurance, as far as I know. But the better your insurance coverage, the more willing a good facility is to take you as a patient. So if you don't have insurance but are involuntarily committed, you may end up in a less-than-ideal facility. Though there are some charity hospitals, most require you to pay any balance your insurance doesn't cover.
My knowledge is limited to my own experiences, but I can tell you that as a mother, I thought very long and hard about allowing my son to be seen by the psychiatrist in one of these facilities for an intake interview, because I was told, in no uncertain terms, that if the doctor found him a danger to himself or others, he would be admitted and I would not have any right to remove him. He would not be allowed to leave, even if he felt better. I couldn't just go pick him up and take him home. He would be there until the doctor released him.
Even before the interview, they took away both our cell phones, my purse, his wallet, belt, and shoes. This wasn't a dark and scary mental institution, either, but a prominent and well-respected treatment facility. Their procedures are fairly standard, from what I understand. So, my son quickly decided he wasn't suicidal after all, and felt we could deal with the situation on our own, with the help of a psychologist. I took him (he was 20 years old, by the way) and we left, not willing to put our trust in the doctor, worried that once my son was inside, he might be detained well beyond the amount of time he wanted to stay. He wasn't willing to give up his freedom.
I hope this information helps. Others might have different experiences.