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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

one - line text box and a push button

Status
Not open for further replies.

ABJ

Technical User
Aug 29, 2000
16
AU
Hey guys i need some help i would like to make a page which is like a java script password pop up box that adds .htm on the the text that you type in and i would like to make it on the page with out having a pop up box. if any ony can help i will be very greatful
Regards Al TIA

here is the code
_____________________________________________

<html>

<head>
<title></title>
<style type=&quot;text/css&quot;>
<!--

A:link {text-decoration: none;}
A:visited {text-decoration: none;}
A:hover {text-decoration: underline overline; overline; color:navy;}

-->
</style>
</head>

<body onload=&quot;grasppasswd();&quot;>
<div align=&quot;center&quot;><center>

<table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;1%&quot; height=&quot;1&quot;>
<tr>
<td width=&quot;100%&quot; align=&quot;center&quot; height=&quot;1&quot;><topmargin=&quot;10000&quot; leftmargin=&quot;10000&quot; vlink=&quot;#FFFFF&quot; alink=&quot;#FFFFF&quot;></td>
</tr>
</table>
</center></div>

<p align=&quot;center&quot;><script language=&quot;JavaScript&quot;><!--
//-
function grasppasswd() {
var keyword = prompt(&quot;Please enter Bulletin Number:&quot;, &quot;&quot;)
var pagename = keyword + &quot;.htm&quot;
this.location.href = pagename;
}
// -
// --></script></p>
</body>
</html>

_____________________________________________
 
I have a feeling that I'm missing the point of what you're trying to do here. If you want to get the input from a user on a page instead of the prompt, just use a form:

<pre>
<form>
Please enter a bulletin number: <input type=&quot;text&quot; name=&quot;bulletin&quot;>
<input type=&quot;button&quot; onClick=&quot;location.href=this.form.bulletin.value + '.htm';&quot; value=&quot;Go!&quot;>
</form>
</pre>

Of course, validation checking should be added to make sure the value in the text box makes sense.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top