it doesn't work
This is almost never a complete description of an error condition. What exactly are you doing, and what is (not) happening?
Is the function being called? Is document.form.text1 a valid form element?
What does your form HTML and JavaScript look like?