473,390 Members | 1,323 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,390 software developers and data experts.

Stop Counter++

This is my first post and I'm with Javascript a newbie I have this question:

Iím using a function to pass text from a dropdown menu in a textbox, each line that is passes in the textbox should have a number before it, and when the number is reaching 12 it should not be possible to pass any text in the text box. So I was thinking that if i=12 the function should be disabled and the user should get an alert but How can I do this ?

Thanks for any reply

Var i= 0

oldvalue = "";
function passText(passedvalue) {
if (passedvalue != "") {
var totalvalue = passedvalue+"\n"+oldvalue;
document.displayform.itemsbox.value = (i++) +totalvalue;
oldvalue = document.displayform.itemsbox.value;

Mar 28 '07 #1
3 2551
16,027 Expert Mod 8TB
Welcome to TSDN.

At the beginning of your function, add the line:
Expand|Select|Wrap|Line Numbers
  1. if (i == 12) return;
Mar 29 '07 #2
Thanx this is what I needed!!!
Mar 29 '07 #3
16,027 Expert Mod 8TB
You're welcome.
Mar 30 '07 #4

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

Similar topics

by: Chua Wen Ching | last post by:
Hi there. I am displaying a string which will appear 1 char at a time. The problem is after it display the 1st string, it will keep on continue. When i uncomment the myTimer.stop(), it does...
by: Frank Rizzo | last post by:
Hello, My c# based windows service takes a while to dispose. I have to release bunch of resources all over the place and unfortunately it can take 20-40 seconds before I can cleanly exit. ...
by: Brett | last post by:
I have several controls on a form. Each control has various events. The flow may go like this: control1.event1 control2.event1 control1.event2 control3.event1 How can I stop this chain in...
by: mumebuhi | last post by:
I am having problem to kill the following script completely. The script basically does the following. The main thread creates a new thread, which does a completely useless thing, and then starts...
by: many_years_after | last post by:
Hi, pythoners: There is a problem I couldn't dispose. I start a thread in the my program. The thread will do something before executing time.sleep(). When the user give a signal to the main...
by: complexc | last post by:
I am having trouble figuring out how to stop from the loop using EOF. I need to use a while loop in main and use EOF to stop it. Can anyone guide me. This is part of the program I was asked to do:...
by: blackstormdragon | last post by:
Here were our instructions: "My mother always took a little red counter to the grocery store. The counter was used to keep tally of the amount of money she would have spent so far on that visit to...
by: Jon Slaughter | last post by:
I'm using Thread and ThreadStart to create a thread for testing purposes and I do not want to use a pool because the thread exists for the life time of the app. Eventually I might move on to using...
by: Adhal | last post by:
Hi, How can I stop hotlinking to a specific file, and I want it to redirect it to a PHP link so I can monitor the number of downloads. Here is my site with the download page:...
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.