If you want a javaScript to use the data on your page, form or not, you need to call the javascript function from your page. When you do a "SUBMIT" of the form you're going back to the server with the form data (those that have name='something' attribute). On the server side I personally prefer giving it to php. This will render a new page with whatever content you have built into it.
On your page, you need an "onclick" event and a target file which will be your javascript function. All of the data on the page is accessible. To learn how to do this you need to access the desired data, in general, via DOM. This can be learned about (easy tutorial)
here.[
^]