Jump to content

Apply onkeyup to inputs in Forms API


modifiedcontent
 Share

Recommended Posts

I am trying to apply onkeyup or jquery keyup to a PW form - to autogenerate a username from a real name.

This javascript/jquery works fine on test html input fields:

  Reveal hidden contents

But I can't get it to work on the fields generated by the PW forms API, even though the input id names are exactly the same.

What am I missing? 

Link to comment
Share on other sites

Perhaps there's already a keyup event on the input, perhaps try this (note that it's using $(document) to make the event fire even if the elements are added later to the DOM):

$(document).on('input propertychange', '#fullname', (function(event) {

But Zeka's suggestion could also work.

Link to comment
Share on other sites

  On 11/7/2016 at 3:15 AM, modifiedcontent said:

Any way to delete this thread?

Expand  

Why? Someone might still find it useful in the future. Especially if you edit your original post, fix this line and provide a short explanation.

Sure, this thread could be moved to the Dev Talk topic, so perhaps a Moderator can help us out...

  • Like 2
Link to comment
Share on other sites

 Share

×
×
  • Create New...