"John" <jo**@hokykoky.com> wrote in message
news:5a**************************@posting.google.c om...
I am a VB programmer and know nothing about Javascript. I have a Java
Button in my asp page (It came with Visual Studio 6) and I want it to
open a page called DBSearch.asp. I also want it to take with it a
variable in the Input (Text Box) I have above the button (Looks like
the Google search page) - I have no clue... Any help much appreciated.
What is a Java Button? It sounds like you just want to submit a form, no
javascript required.
<form action="DBSearch.asp" method="get">
<input type="text" value="" name="TextBoxName">
<input type="submit">
</form>
Now if anyone clicks submit, DBSearch.asp will be loaded with the string
"?TextBoxName=" attached to the URL. If they entered something into that
textbox before submitting, that text will be attached too. I don't see where
javascript would be needed.
If you insist and favor unreliable javascript over forms, something like
this would do thesame thing:
<input type="text" value="" id="TextBoxName">
<input type="button" value="Submit" onclick="location.href =
'DBSearch.asp?TextBoxName=' +
escape(document.getElementById('TextBoxName').valu e) ;">
The onclick string is on one line. It would require the browser
understanding getElementById,
HTH
Ivo