Inclusion of HTML variables in form fields. - Javascript help.

They have: 3 posts

Joined: Jul 1999

Does anyone know a simple way to include the content of an HTML variable as a field in a form?
To date I have been extracting the variable (a PDF filename) and printing on the page using ..document.write.. This still means the users has to manually type the the file name before downloading it.
I have tried many different ways to import the variable into the field but have had no success.
Any suggestions would be greatfully received.

John Pollock's picture

He has: 628 posts

Joined: Mar 1999

I think I almost get what you are after, but I'm not quite positive. Are you trying to use a JavaScript variable value to get it to automatically show up in a form box?
It should be possible if all is on the same page, but if not you would likely need to resort to CGI, ASP, or PHP to get it done.

They have: 76 posts

Joined: Apr 1999

Steve,

You said you're already extracting the variable from the URL? If that's the case then you're halfway there!

Just use a simple document.formname.elementname.value = variable

Execute it on body Onload and you should have it.

If you need to know more, let me know.

Later,
PJ

They have: 3 posts

Joined: Jul 1999

I have been using javascipt to extract the variable from the page URL and if possible I would like this variable value to automatically show up in a form box, so that the user does not have to input the variable(a filename).
The all of this takes place on the single page.

----------
Steve
Counterclockwise Design

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.