You can use jQuery for this, and you can also create a custom field for this, just simply copy and paste the previous file and display the Sitecore.Forms.Core.dll file and see the code how you can do this. But I usually use jQuery if I can manage using this
source share