I'm working on a custom field that will store a string. The text will have a custom formatter applied to it that will manipulate the structure of the string (adding dashes in the right places). I have a javascript that will apply those changes in the field's input textbox when creating a new content type with the custom field, but I can't figure out how to fire the javascript when the user enters the text. Can it be done and if so can anyone point me in the right direction?
Tell me more
×
Drupal Answers is a question and answer site for
Drupal developers and administrators. It's 100% free, no registration required.
|
You probably want to use Drupal behaviors which is a wrapper of sorts for JQuery. With JQuery you can make it so that everytime your textfield gets edited your Javascript code gets executed. Behaviors/JQuery is a big subject and will take time if you're not familiar. You can start here |
|||
|
1.With the help of onblur() function,you can trigger the written js. 2.onblur() function helps you in calling a js once the text is entered in the input field and the user press ENTER after entering the text. |
|||
|