Add Attribute to Input ID
-
Hello!
I am running the following script on my Registration page to automatically populate the username.<script type="text/javascript" charset="utf-8"> function updateUsername(){ first = document.getElementById("first_name-562").value.toLowerCase(); last = document.getElementById("last_name-562").value.toLowerCase(); document.getElementById("user_login-562").value = first+"-"+last; } </script>
How can I add the attribute
onkeyup="updateUsername();"
to the input id of first_name-562 and last_name-562?Currently I have manually added the first_name, last_name, and user_login fields by adding them to my registration template. This technically has worked but is causing other issues.
Here is a picture of how the script and the three input fields are setup currently.
Thanks in advance for any help that can be provided!
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Add Attribute to Input ID’ is closed to new replies.