Form input value validation

I am using a text parameter in a web port as part of a file name, and would like to confirm that what was typed in does not have bad file characters. Based on this post:

https://community.accelrys.com/message/5173

it seems that parameter validation will not be available. Do you have examples of javascript web form text box value validation?