Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML Button Link 1

Status
Not open for further replies.

MattSTech

Programmer
Apr 10, 2003
333
US
Hello,
Extremely new to HTML.
I have a simple question I assume.
The following displays a password field and a submit button. I would like the page to jump from where it is at:

to

from password box here".htm

<center><input type="password"name="textfield2" size="8"maxlength=""><input class=button type=submit value="Get Document"></a></center>

Certainly do-able, I hope...

Thanks.

Matt
 
Thanks for the warning about the multiple popups and homepage modifications. How about turning those off before posting your site URL?

Gripe aside, to answer your question, try this:

Code:
<center><input type="password" name="textfield2" size="8"><input type="button" value="Get Document" onclick="document.location = '[URL unfurl="true"]http://www.mysitename.com/'[/URL] + document.forms[0].textfield2.value + '.htm';"></a></center>

This does, of course, assume your form is the first on the page. You can modify the [0] if it isn't.

Hope this helps,
Dan
 
I am so sorry. That isn't actually my site. I just put in a random name to get my point across. Please accept my apologies to you BillyRayPreachersSon and to whoever's site this actually is.

Thanks for the response. I will try it out soon and let you know.
 
I am getting an error that says document.forms[0].textfield2 is null or not an object. Where do I declare this object?
 
textfield2" isn't a method by the way. Your method should be "POST" or "GET". As Dan said, make sure the form you're using is the first on the page. Otherwise, you'll need to change to 0 in document.forms[0].
 
it seemed to work by adding that line, I worked with it and i doesn't seem to matter what I put after it, as it still works. As mentioned I don't write HTML but here and there, so any suggestions on proper usage are welcomed.

Thanks for the help

Matt
 
If the form method isn't known, it will default itself to a proper method. Probably "GET".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top