Commit 4d332a61 by JayGuri

Form validation done, Navbar changed

1 parent af371728
...@@ -200,12 +200,15 @@ const CallBackRequest = () => { ...@@ -200,12 +200,15 @@ const CallBackRequest = () => {
required required
type="text" type="text"
className="form-control" className="form-control"
{...register("Mobile", { onInput={(e) => {
required: "Enter Your Mobile Number", e.target.value = e.target.value.replace(/[^0-9]/g, '');
maxLength: { }}
value: 10, {...register("Mobile", {
message: "Invalid Mobile number", required: "Enter Your Mobile Number",
}, maxLength: {
value: /^[6-9]\d{9}$/,
message: "Invalid Mobile number",
              },
})} })}
/> />
{errors.Mobile && ( {errors.Mobile && (
...@@ -219,30 +222,18 @@ const CallBackRequest = () => { ...@@ -219,30 +222,18 @@ const CallBackRequest = () => {
<div className="form-group"> <div className="form-group">
<label>Services</label> <label>Services</label>
<Form.Group> <Form.Group>
<Form.Control as="select" <Form.Control
required type="text"
type="select" placeholder="Enter Service"
{...register("service", { required
required: "Select Service", {...register("service", {
})} required: "Enter Service",
className="form-select"> })}
className="form-control"
<option disabled> Select Service</option> />
<option value="Virtual FC & CFO Services">Virtual FC & CFO Services</option> {errors.service && (
<option value="Transaction Advisory">Transaction Advisory</option> <span className="error">{errors.service.message}</span>
<option value="Risk Advisory">Risk Advisory</option> )}
<option value="Business Advisory">Business Advisory</option>
<option value="Personal Tax">Personal Tax</option>
<option value="Corporate Tax" >Corporate Tax</option>
<option value="Company Law & FEMA">Company Law & FEMA</option>
<option value="Transfer Pricing">Transfer Pricing</option>
<option value="GST & other Indirect Tax">GST & other Indirect Tax</option>
<option value="Family Business Advisory">Family Business Advisory</option>
<option value="Others">Others</option>
</Form.Control>
{errors.service && (
<span className="error">{errors.service.message}</span>
)}
</Form.Group> </Form.Group>
</div> </div>
</Col> </Col>
......
...@@ -198,10 +198,13 @@ const ContactForm = () => { ...@@ -198,10 +198,13 @@ const ContactForm = () => {
type="text" type="text"
placeholder="Mobile" placeholder="Mobile"
className="text-dark form-control" className="text-dark form-control"
onInput={(e) => {
e.target.value = e.target.value.replace(/[^0-9]/g, '');
}}
{...register("Mobile", { {...register("Mobile", {
required: "Enter Your Mobile Number", required: "Enter Your Mobile Number",
maxLength: { maxLength: {
value: 10, value: /^[6-9]\d{9}$/,
message: "Invalid Mobile number", message: "Invalid Mobile number",
}, },
})} })}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!