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

Input Validation

Status
Not open for further replies.

Oxymoron

Technical User
Dec 17, 2000
168
GB
Hiya, I am very new to programming, but I find VB Script quite easy and fast. Especially on websites I make!
My problem is, I want to make the variable that people input into a form input box (e.g. thier search criteria) then the variable (Document.search.criteria.Value) to become the first part of the destination they are sent to after they have submitted.
So far I have-

<html>
<script language=VBScript>
Function search
dim search
If search = &quot;joe&quot; then
msgbox &quot;hi&quot;
Else
msgbox &quot;bog off&quot;
End If
End Function
</script>
<body>
<form name=&quot;search&quot;>
<input type=&quot;text&quot; name=&quot;txtsearch&quot; size=20 maxlength=100>
<input type=button value=&quot;!go!&quot; onClick=&quot;search&quot;>
</form>
</body>
</html>

If anyone knows anyay of making this happen! Please Reply! cheers
 
Try this instead:



<Form Method=Post>
<Input Type=Text Name=&quot;TxtSearch&quot;>
<Input Type=Button Name=Submit Value=&quot;Search&quot; onClick=&quot;goSearch()&quot;>
</Form>


<Script Language=VBScript>
Sub GoSearch()
If condition then
action
Else
other action
end if
End Sub
</Script> tvuong@kempercm.com
Programmer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top