How do I add a body onload javascript function for a create content page in drupal?
I want assign certain val开发者_StackOverflowues to some of the cck fields through Java script while the form is loaded. I think it is best to use the body/ form onload attribute. But how do i define that in drupal? Could someone help me with this or a better solution?
As with many other tasks, Drupal has its own 'way' of handling JavaScript functionality within a site. It needs a little bit of learning and 'getting used to', but pays of in the long run.
Start with JavaScript in Drupal and work through the articles linked from there. Also, don't miss this overview of the JavaScript API.
精彩评论