Instead of displaying the preview in an extra field below, a more user-friendly approach would be to alter the existing "URL alias" field provided by Pathauto.
Active
1.0
Code