I'm trying to use jquery in a form of mine that is rendered via the form api.
How i'm getting jquery to work now is like so
$form['raf_raffle_name'] = array(
'#type' => "textfield",
"#prefix" => "<h5>Raffle information</h5><hr>",
"#title" => "Raffle Name:",
"#required" => TRUE,
"#attached" => array(
'js' => array(
"$path/jquery.js", "$path/test1.js"
),
)
);
well it works, but i'm not sure if its the right way. Is there a better way? I'm inclined to ask after i saw the 'library' attribute which is supposed to load up certain javascript plugins.