Hello @Saqib Ahmed This can be done by using JavaScript. Please refer to https://learn.microsoft.com/en-us/azure/active-directory-b2c/javascript-and-page-layout?pivots=b2c-custom-policy#guidelines-for-using-javascript for enabling JavaScript for B2C User Flow/Custom Policy.
-----------------------------------------------------------------------------------------------------------
Please "Accept the answer" if the information helped you.