function MYMODULE_form_user_login_block_alter(&$form, &$form_state) {
$form['#attached']['js'] = array(
drupal_get_path('module', 'MYMODULE') . '/js/login_form.js',
);
}
login_form.js
==========
(function ($) {
$(document).ready(function() {
var name = document.getElementById("edit-name");
name.value = "demo";
var pass = document.getElementById("edit-pass");
pass.value = "password";
});
})(jQuery)
No comments:
Post a Comment