I Create a sample HTML registration form,
here I used textarea for the address, which is required, But that is not working respectively.
<form>
<label>Name:</label>
<input type="text" placeholder="Name" id="name" required/><br>
<label>Email:</label>
<input type="text" placeholder="Email" id="email" required/><br>
<label>Phone:</label>
<input type="number" placeholder="Phone" id="phone" required/><br>
<label>Gender:</label>
<input type="radio" value="male" name="gender" id="gender" required/>Male
<input type="radio" name="gender" value="Female" id="gender" required/>Female
<br>
<label>Select City:</label>
<select id="city" required>
<option>Ahmedabad</option>
<option>Surat</option>
<option>Rajkot</option>
<option>Jamnagar</option>
</select><br>
<label>Address:</label>
<textarea required placeholder="address" id="address"></textarea><br>
<button type="submit" onclick="getData()">Submit</button>
I want, Without an Address, the form will not be submitted.
New contributor
Priya Prajapati is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1