Title: Use javascript on a profile field backend.
Last modified: June 8, 2018

---

# Use javascript on a profile field backend.

 *  [Gustav](https://wordpress.org/support/users/4ever16/)
 * (@4ever16)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/use-javascript-on-a-profile-field-backend/)
 * All users needs to write “website” in their profile field.
    If a user has `https://
   XXX.org` in that field i would like to replace it with something else. So basicly
   i would like to know where i can play around with this “website” field, actual
   file. For example put a simple javascript in that.

Viewing 1 replies (of 1 total)

 *  [Joey](https://wordpress.org/support/users/leglesslizard/)
 * (@leglesslizard)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/use-javascript-on-a-profile-field-backend/#post-10380503)
 * Hey,
 * Do you want to change this field while the user is present e.g. as they type?
   Or do you want to modify the value they enter when they submit the form to save
   it?
 * If the first, I’d look at [creating a simple plugin](https://codex.wordpress.org/Writing_a_Plugin)
   that [enqueues a script](https://developer.wordpress.org/reference/functions/wp_enqueue_script/)
   when the page [is the user profile page](https://wordpress.stackexchange.com/questions/7278/how-can-you-check-if-you-are-in-a-particular-page-in-the-wp-admin-section-for-e#answer-7281).
   In this js file you could alter the field on the fly or provide error messages/
   notices to the user to guide the input.
 * If the second, I’d look at hooking in on the filter before a users data is saved
   and alter the URL there. I’m unsure why you’d want to do this, however. But the
   filter to look at would be [wp_pre_insert_user_data](https://developer.wordpress.org/reference/hooks/wp_pre_insert_user_data/)

Viewing 1 replies (of 1 total)

The topic ‘Use javascript on a profile field backend.’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [Joey](https://wordpress.org/support/users/leglesslizard/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/use-javascript-on-a-profile-field-backend/#post-10380503)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
