Hi!
I create a form and I need ad a function with onclick. I prepare javascript file, I include this in my Page.php and i create the form like this:
How can I add onclick="scrivi_campo();" in my button?
function Ricerca() {
Requirements::javascript("themes/paddygreen/javascript/formsearch.js");
$fields1 = new FieldSet(
new TextField(
$name = "text",
$title = "Testo:",
$value = ""),
new HiddenField("error", "error", "1")
);
$validator = new RequiredFields('text');
$actions = new FieldSet(
new FormAction('doRicerca', 'CERCA')
);
return new Form($this, 'Ricerca', $fields1, $actions, $validator);
}