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

Display htm doc based on keyed in input 1

Status
Not open for further replies.

jiol2

IS-IT--Management
Aug 14, 2003
7
US
Using an input field and a get button I am try to link to an htm document based on the input (passcode) of the user.

Example: Various users have only one passcode assigned to them. Each passcode (approx 30 in total) will only link to a pre designated page.

I have tried using and input filed an a get button and I can't seem to pass the inputted data to the action of the button.

any clues out there?

Thanks
Jiol2
 
is your text box and button surrounded by a form?

E.G.:

Code:
<form action=processingpage.xxx method=GET>
<input type=text name=passcode>
<input type=submit value="Send" name="submit">
</form>



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Yes.
Here is a copy of the code.

<body>
<form name="form1" method="post" action="">
<input type="submit" name="Submit" value="Submit">
<input type="text" name="textfield">
</form>
</body>
 
Sorry....
Here is the correct coe:

<body>
<form name="form1" method="get" action="">
<input type="submit" name="Submit" value="Submit">
<input type="text" name="textfield">
</form>
</body>
 
Give the form an action, like the name of the script that's supposed to get the passcode and pull de document for that passcode.

If its in the same page, then just put that in the action.
Code:
<form name="form1" method="get" action="[red]myprocessingpage.html[/red]">

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
I can not hard code the html page because it will be different for each different passcode.

I am thinking that the passcode needs to be entered into the input field (the passcode would be the actual name of the htm page. I.E. passcode is "CLFCCFBL" the htm page will be "CLFCCFBL.HTM") Each passcode is unique to each htm. I have 30 different passcodes with 30 different htm document.

Thanks
 
Then, then you'll need to have javascript change the action on the fly to the entered passcode. something like this should work:

Code:
<form name="form1" method="get" action=""  OnSubmit="form1.action=form1.textfield.value + '.htm'; return true;">



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
A BIG THANK YOU TO VACUNITA!

It works great!
Thank you for your time.

Jiol2
 
You are welcome. Glad I could help.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top