How to apply validation on popup child form

how to apply validation on popup child form?
I have 2 doctypes sales data and sales customer. All the customer related information is saved in sales customer and bill will be generated in sales data for purchased item.
I had applied all form validation on sales customer form but when the same form open as popup through sales data that time no validation works.
Please help

you can apply it on validate event of py side.

import re

def validate(self):
regex = re.compile(“\d{10}”)
if re.search(regex, self.number):
print(“*********************************Valid phone number”)
else:
frappe.throw(“Invalid Mobile Number”)

Thanks its working