This is dangerous. It is very important that the kidneys get two litres of fluid each day to do their work in eliminating waste products efficiently. The answer is to plan fluid intake. Don't drink large volumes of fluid just before going out or going to bed. The same amount of fluid might be easily handled spread over a longer period of time.
Beverages containing caffeine and alcohol can make urgency and frequency problems worse.
You may wish to limit these. Appropriate clothing, padding and devices for incontinence are available at reasonable cost and can be invaluable in coping with lack of control. These are available at drug stores or medical supply companies. Shop around and compare prices since costs may be different from place to place. Let your doctor sort out the cause and recommend treatment.