473,327 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Very easy one...About Buttons..

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.
Example code would be the best...

After I dragged it onto my ASP page I created the following
function button1_onclick() {
}

But I do not know what syntax I need inside...

Regards
John
Jul 20 '05 #1
4 1374
Ivo
"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
Jul 20 '05 #2
Thanks Ivo, but this is still confusing. I dragged the button from the
HTML Toolbox. Now I want to code the button. The code says that it is
a Javascript button, I would much prefer VBScript myself but it seems
only to give me a Javascript option.

Also the code example you gave, where would I put it in my asp page -
yes, sorry, I am that much of a beginner... The code below is what I
got when I put in the button, how do I tell it to do what I mentioned
before.
<P align=center><INPUT type=button value=Search id=button1
name=button1 LANGUAGE=javascript onclick="return
button1_onclick()"><INPUT style="WIDTH: 62px; HEIGHT: 24px"
type=button size=25 value=Clear></P></TD>

Thanks for your help..
John

"Ivo" <no@thank.you> wrote in message news:<40***********************@news.wanadoo.nl>.. .
"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

Jul 20 '05 #3
Ivo
"John" <jo**@hokykoky.com> wrote in message
news:5a**************************@posting.google.c om...
Thanks Ivo, but this is still confusing. I dragged the button from the
HTML Toolbox. Now I want to code the button. The code says that it is
a Javascript button, I would much prefer VBScript myself but it seems
only to give me a Javascript option.

Also the code example you gave, where would I put it in my asp page -
yes, sorry, I am that much of a beginner... The code below is what I
got when I put in the button, how do I tell it to do what I mentioned
before.

<P align=center><INPUT type=button value=Search id=button1
name=button1 LANGUAGE=javascript onclick="return
button1_onclick()"><INPUT style="WIDTH: 62px; HEIGHT: 24px"
type=button size=25 value=Clear></P></TD>
First time I see a language attribute with an input element... Also I don't
see the other textbox value that you would like to take to the next page.
Really, all this button needs to do, collect data and forward to a new page
with this data, can be done with an ordinary HTML form. It 's exactly what
they were invented for back in HTML 0.1. Try it with the 4 lines of form
code below, put it in the place where you found the above Input tags and
tell us what 's not working if something isn't working.
Cheers,
Ivo
<form action="DBSearch.asp" method="get">
<input type="text" value="" name="TextBoxName">
<input type="submit">
</form>

Jul 20 '05 #4
Thanks Ivo, you are completely correct, I was getting way too
complicated for my own good - its works great, thanks a ton.

Regards
John

"Ivo" <no@thank.you> wrote in message news:<40***********************@news.wanadoo.nl>.. .
"John" <jo**@hokykoky.com> wrote in message
news:5a**************************@posting.google.c om...
Thanks Ivo, but this is still confusing. I dragged the button from the
HTML Toolbox. Now I want to code the button. The code says that it is
a Javascript button, I would much prefer VBScript myself but it seems
only to give me a Javascript option.

Also the code example you gave, where would I put it in my asp page -
yes, sorry, I am that much of a beginner... The code below is what I
got when I put in the button, how do I tell it to do what I mentioned
before.

<P align=center><INPUT type=button value=Search id=button1
name=button1 LANGUAGE=javascript onclick="return
button1_onclick()"><INPUT style="WIDTH: 62px; HEIGHT: 24px"
type=button size=25 value=Clear></P></TD>


First time I see a language attribute with an input element... Also I don't
see the other textbox value that you would like to take to the next page.
Really, all this button needs to do, collect data and forward to a new page
with this data, can be done with an ordinary HTML form. It 's exactly what
they were invented for back in HTML 0.1. Try it with the 4 lines of form
code below, put it in the place where you found the above Input tags and
tell us what 's not working if something isn't working.
Cheers,
Ivo
<form action="DBSearch.asp" method="get">
<input type="text" value="" name="TextBoxName">
<input type="submit">
</form>

Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: David | last post by:
I made a navbar where the buttons light up when the user moves over them. The only problem was in IE the buttons only light up when hovering over the text. This was not a problem in opera!...
10
by: Brian | last post by:
Hello all, I have an form to Enter a Name with letters from A to Z in buttons. When you click a button, it should append the text associated with that button to a text box. Instead of...
3
by: John Hoge | last post by:
I need to do something on a page with a datagrid in the case where the page is loaded but the Update button is *not* clicked. Specifically, I am adding a blank row to the dataset with an external...
7
by: Alan Silver | last post by:
Hello, I've just been looking at the free PayPal component from ComponentOne and am somewhat amazed how insecure it is. They include all the transaction details in plain text in the querystring,...
4
by: wim taerwe | last post by:
Hello, I am looking for an easy way to have a delete button per subitem in 1 form. For example : a book can have many authors and when I edit the book details I want to have a list of the...
12
html on wheels
by: html on wheels | last post by:
Greeting sports fans. In order to ask multiple questions and not have your radio buttons jump from one question to the next, what do you type to create a break between them. I am trying to complete a...
7
by: Bruno43 | last post by:
Hi I am trying to learn Visual Basic and I am getting everything for the most part, mainly because of my ability to read code like a book, but my question is what is the best way to Navigate through...
4
by: rubyhcurry | last post by:
Hello, I have a small application which acts like a wizard with 5 steps. I use a tab control, and 'back' and 'next' buttons to switch between the 5 tabs (1 tab page for each step). The...
4
by: Rick Stevens | last post by:
I am not an access expert, could anyone tell me if the following would be easy to do?? I receive emails from a specific email address, that advise me if a specific piece of equipment my company...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.