473,651 Members | 2,716 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting textbox input and validating it for numerical value

1 New Member
I have an assignment where I need the user to enter a number between 40 and 60 in a textbox. I have to check to make sure it was between 40 and 60 and if it isn't I have to alert them to that.

Can someone give me some guidance?
Jun 13 '07 #1
3 2266
RedSon
5,000 Recognized Expert Expert
I have an assignment where I need the user to enter a number between 40 and 60 in a textbox. I have to check to make sure it was between 40 and 60 and if it isn't I have to alert them to that.

Can someone give me some guidance?
I can only give you general help because I don't know what language you are talking about. First you will need to get the text from the text box. This usually comes in the form of a string, so you will have to convert that string to a number. Look in the standard library for functions that do this for you. Then you will have to run a test to see if the number is between 40 and 60. If it is then you can continue. And if it is not you can alert them via a message window or some kind of alert.
Jun 13 '07 #2
debasisdas
8,127 Recognized Expert Expert
I have an assignment where I need the user to enter a number between 40 and 60 in a textbox. I have to check to make sure it was between 40 and 60 and if it isn't I have to alert them to that.

Can someone give me some guidance?
can you kindle post what/how u have tried to solve this problem.
Jun 14 '07 #3
pbmods
5,821 Recognized Expert Expert
Changed thread title to better describe the problem (did you know that 'need help' actually makes people LESS likely to answer your question?).

The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.

Please read the Posting Guidelines and particularly the Coursework Posting Guidlines.

Then when you are ready post a new question in this thread.

MODERATOR
Jun 14 '07 #4

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

Similar topics

3
399
by: rodger | last post by:
How do i validate text box entry, in VB. net In the event that user does not make a text entry, simply pop-up a warning, thanks rodger
1
4266
by: David Smith | last post by:
What I want to be able to do: A textbox is available that the user can enter information into. Specifically (for the purposes of this post), the user is asked to enter a number, and that number has an upper limit. I want to do validation on what the user enters as they type it in. I set up an event handler for KeyPress that restricts them from being able to enter non-numeric characters (only allowing numbers, decimal point, control...
2
2029
by: Colin McGuigan | last post by:
This is a translation of an ASP page to ASP.Net. First, the background: The goal is to have a grid of different settings for the application -- think something along the lines of the Property Page for a control. You have two columns -- the first column is a simple caption, and the second column can be one of a number of controls (textbox, checkbox, dropdownlist, etc) for each row. So row #1 might have a textbox in the second column,...
9
2084
by: rodger | last post by:
Hi all, how do I set a Textbox to only accept numerical values in vb .net many thanks rodger
5
13082
by: Reny | last post by:
can any one tell how can i restrict my user to type just numeric character in the textbox.I am using VS.NET 2003 (VB.NET)
14
14597
by: teddysnips | last post by:
WINDOWS FORMS I've a form that has a textbox that allows the user to enter a string. On the LostFocus event, the textbox formats the string into a preferred format. However, if the user presses the "Save" button while the textbox has the focus, the LostFocus code doesn't run at the right time, so that the "Save" function is dealing with an incorrectly formatted string and the whole caboodle goes splat.
5
21273
by: YardDancer | last post by:
Hi all I don't want to use the the Cint() or CDec() or other VB.Net Functions and I dont want to restrict keystrokes in the textbox. I am also using the "strict type semantic" settings that requires you to explicitly state all conversions. --
14
2397
by: n3o | last post by:
Hello Comp.Lang.C Members, I have an issue with user input that I have been trying to figure out for the longest. For instance, let's say you have something like this: void foo() { int num; printf("Please enter a number: "); scanf("%d", &num); // yes I know this function may throw a
7
6541
by: weg22 | last post by:
Hi all, I need to impose maximum and minimum numerical limits on a textbox. I'd prefer not to code these in (since I have many textboxes and the limits on each are different) and was wondering if there is any way to do this within the textbox properties? For example, I know the "NumericUpDown" has maximum and minimum properties so that you can specify a range. This would be perfect, however, I'm not a fan of the up/down arrows on the...
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8802
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8697
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8465
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7297
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5612
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4144
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1909
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1587
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.