How can I run a script inside a form?