I have been trying to pass a value from an external javascript file to an HTML form with no luck. The files are rather large so I am not sure I can explain it all but ill try.>
Your HTML file needs to reference the JavaScript js
file. Have a function in your JavaScript that returns the value that you need. Use JavaScript (I like jQuery) to set the form field to what you need.
JS file:
HTML file:
Ad Code:
Although, really, this might do what you want (depending on what you are trying to do):
Ad Code: