473,499 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

why does the page keep going up?

3 New Member
I've got this code where when you click the '-' or '+' link the text in the textbox increments or decrements. But let's say this is at the end of the page after it is scrolled all the way to the bottom; when I click it, the page zooms back up and it's annoying because I have to scroll down again to click it.

The reason why there are so many breaks is to make it be at the bottom where you have to scroll to access it. Put the code below in the notepad as HTML and view it. When you click the java link, it will zoom back up. Is there anyway I can prevent that? Thanks

-jong

<html>
<head>

<script type="text/javascript">
function increment(test){

if (test.value.charCodeAt(0) < 90){
if(test.value.charCodeAt(0) == 45){test.value = String.fromCharcode(eval(45))}
test.value = String.fromCharCode(eval(test.value.charCodeAt(0) + 1))
}else
test.value = String.fromCharcode(eval(90))
}

function decrement(test){
if (65 < test.value.charCodeAt(0)){
test.value = String.fromCharCode(eval(test.value.charCodeAt(0) - 1))
}else
test.value = String.fromCharcode(eval(65))
}
</script>



</head>
<body>
<form>
Enter random text
<br>
<br>

<br>
<br>

<br>
<br>

<br>
<br>

<br>
<br>

<br>
<br>

<br>
<br>
<br>
<br>

<br>
<br>

<A href="#" onclick="javascript:decrement(num)">-</a>
<input type="text" name="test" value="A" id="num" size="1">
<A href="#" onclick="javascript:increment(num)">+</a>

</form>

</body>
</html>
Aug 3 '05 #1
1 3130

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2326
by: lawrence | last post by:
Maybe its late and I'm tired but I don't understand what I'm seeing on the screen. I have this block of code: $choiceMade = $_GET; if ($simpleMode == "y" && $choiceMade == "") {...
15
2103
by: middletree | last post by:
How do I request the actual page name that I'm on? This is going to go into an include file, and depending on which page I'm on, I'd like to do different things. I'm looking for "pagename.asp"
6
1757
by: greenflame | last post by:
I have been working for some time on a script that will show a matrix with the elements aligned on the right for sometime and finally got it to work. Then I did some patching up and ran the script...
8
1681
by: windandwaves | last post by:
Hi Folk I want to create something like AMAZON: those who liked page A also liked page B (I am going to apply the concept to a few different selections, but to keep it simple I will talk about...
11
3184
by: Brian W | last post by:
Yet another editor problem To reproduce do the following 1) Open a Webform and switch to HTML edit mode 2) Enter the Following (include spaces) This is some text before <asp:hyperlink...
6
2532
by: Nad | last post by:
Hello, In order to go back to the previous page from a page with possible postbacks I keep Request.Referrer in ViewState and then use it to redirect to the previous page. However I am losing all...
14
4813
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it...
130
6376
by: Daniel Manes | last post by:
I'm baffled. I have a column in a SQL Server Express database called "Longitude," which is a float. When I view the table in a DataGridView, some of the numbers, which only have two decimal places...
3
1996
by: salad | last post by:
I have an A97 application that is NOT split on a network. It is used by 15+ folks continually. It is quick and fast. I split it several years ago and had to merge it together again after the...
162
10062
by: Sh4wn | last post by:
Hi, first, python is one of my fav languages, and i'll definitely keep developing with it. But, there's 1 one thing what I -really- miss: data hiding. I know member vars are private when you...
0
7132
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
5475
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4602
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3103
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3094
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
302
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.