Your marriage is absolutely not void. You are saying that you married your husband at a court. That means you had a supervisor (wali) and some people to witness in your marriage, which makes your marriage legal.
The duty and the rights of the supervisors in marriage are usually matters of misinformation. In many countries, supervisors misuse the authority they are granted. Here is how:
A supervisor must be the woman’s father, grandfather, son, brother, uncle, or other male relatives respectively. In many countries, supervisors, who are usually parents or the elders of those who shall marry, force girls or even boys to marry persons of the supervisor’s choice. This is an instance of misusing their authority. Indeed, a supervisor has duties before and during the act of marriage:
He must investigate the groom-to-be whether he meets the conditions that a spouse is required to have according to the Qur’an. Please see the link below to see these conditions:
The supervisor is also required to witness the marriage act while the legal share of bride (mehr)  is determined and the act of marriage is written down, in order to protect the woman’s rights. If the mentioned male relatives of the girl do not exist, or refuse to perform their duty, or attempt to misuse the the authority they hold, the authorized official becomes the supervisor. The almighty God warns the supervisors about misusing their authority by forcing the girls to marry the boys other than of their own choice:
وَلَا تُكْرِهُوا فَتَيَاتِكُمْ عَلَى الْبِغَاءِ إِنْ أَرَدْنَ تَحَصُّنًا لِتَبْتَغُوا عَرَضَ الْحَيَاةِ الدُّنْيَا وَمَنْ يُكْرِهْهُنَّ فَإِنَّ اللَّهَ مِنْ بَعْدِ إِكْرَاهِهِنَّ غَفُورٌ رَحِيمٌ
“… Do not force your young girls to transgression, out of your desire for the possessions of the worldly life if they desire to be married. If anyone forces them, then after they have been forced, Allah is Ever-Forgiving, Most Merciful.” (an-Noor 24:33)
We understand by the verse that the girls who are prevented from marrying the boys they choose may commit types of transgression. We experience the instances of these in daily life. Girls may run away with their beloved ones, or may even be misled to fornication. To avoid such transgression, the supervisors must not transgress the boundaries of the duty of supervision. The nominee of groom being poor or being of a less reputable family or another social group or caste are only obstacles to world’s benefits. The supervisors must not object to the marriage seeking the benefits of the worldly life according to the verse above. So, objections of the supervisor to the marriage due to such reasons are invalid according to the Quran.
Chastity and maturity are only two of the conditions to be sought in a spouse according to the Qur’an. The supervisor’s duty becomes clear when we consider them. For example, unchastity of a boy or man can be witnessed more easily by another man than by a woman, because men have wider access to men-exclusive environments. Another example could be that the maturity of a boy and whether he could maintain a family can be witnessed more easily by an elder man. The supervisor can object to marriage only if the conditions mentioned in the Qur’an are not fulfilled by the groom-to-be. Any other objections is considered groundless about marriage, and if the supervisor insists on a groundless objection he loses his right to supervise. Thus, the authorities in charge become the supervisor.
Today, there is nowhere in the world that permits marriages without supervision. Officials of the municipalities, churches, synagogues are examples of authorized supervisors for marriage.
The Messenger of Allah says:
“There is no marriage without a supervisor (Wali) and two reliable witnesses. A marriage performed without these is void. If they couldn’t agree, the authorized officials are the supervisor.” (Abu Dawood, Nikah/Marriage, 20; Tirmidhi, Nikah/Marriage, 14; Ibn Majah, Nikah/Marriage, 15; Ahmad Ibn Hanbal, Musnad, 6/66)
Prophet Muhammad (pbuh) did not require walee for men and sufficed the approval of walee for women, which eases marriage and lets happy families be established.
 “Mehr = “مهر”, translated as “legal share of bride”, is the possessions or money that a man has to grant his spouse upon marriage. Its amount is determined during the act of marriage. If it is not determined, then this right automatically arises for the woman and the amount is determined in comparison to the mehr of a woman who is equivalent to the bride.