473,406 Members | 2,769 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,406 software developers and data experts.

Using switches and number ranges

Hello again,

Now I am trying to create a form within Adobe Acrobat in which a field
(field A) displays a number based on another field (field B). I need
to use ranges of numbers. For instance, whenever field B displays a
number between 0 and 999, field A should display 1. When field B
displays a number between 1000 and 3000, field A should display 2. How
would I go about setting this up using javascript? Thanks in advance
for the help!

cytec123187

P.S. - Thanks for the help with the other problem! I was able to set
up and use the table! Hooray!

Apr 26 '06 #1
1 1303
cy*********@gmail.com said on 27/04/2006 8:29 AM AEST:
Hello again,

Now I am trying to create a form within Adobe Acrobat in which a field
(field A) displays a number based on another field (field B). I need
to use ranges of numbers. For instance, whenever field B displays a
number between 0 and 999, field A should display 1. When field B
displays a number between 1000 and 3000, field A should display 2. How
would I go about setting this up using javascript? Thanks in advance
for the help!

cytec123187

P.S. - Thanks for the help with the other problem! I was able to set
up and use the table! Hooray!


You may have under-specified the requirements - guessing that 'between'
means 'inclusive', that the number is an integer and that negative
values indicate an error, then a simple function would be:

function getValue(num)
{
if (num < 0) return null; // Or some error message
if (num < 1000) return 1;
if (num < 3001) return 2;
return null; // Or some error message

// What if num > 3000?

}

Now use some event to set the value of field A:

fieldA.value = getValue(fieldB.value);
Modification is probably required to meet your full requirements.
--
Rob
Group FAQ: <URL:http://www.jibbering.com/FAQ>
Apr 27 '06 #2

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

Similar topics

15
by: Roman Töngi | last post by:
I want to get a random number between 0 and 1. The following code works but it seems to me a litte awkward. Is there a "better" solution. double rnd; int integerRnd; ...
2
by: Ben O'Steen | last post by:
Scenario: ========= Using PyGame in particular, I am trying to write an application that will run a scripted timeline of events, eg at 5.5 seconds, play xxx.mp3 and put the image of a ball on...
16
by: John Hanley | last post by:
I created a function that breaks down a date into broken down time, I subtract a certain number of seconds from that, then use mktime() to recompute the calendar time. It works basically except...
5
by: Heiko Wundram | last post by:
Hi all! I'm wondering whether there is some form of number set type implemented in pure Python. I'm currently in the process of implementing one myself (for an IPv4 address range type), and if...
5
by: Bruce | last post by:
Hello I am building a C# app that creates anywhere from 10 to 100 connections to a specified server and sends 1000s of TCP requests and processes the responses. (it is a stress tool) I planned...
3
by: hello2008 | last post by:
Hi, I donot have much knowledge of R.Exp. In my web page I am required to validate numeric textboxes allowing signed/unsigned integer/float numbers and then compare between them. I need the...
30
by: bdsatish | last post by:
The built-in function round( ) will always "round up", that is 1.5 is rounded to 2.0 and 2.5 is rounded to 3.0. If I want to round to the nearest even, that is my_round(1.5) = 2 # As...
0
by: zephyrus360 | last post by:
This is about a technique to find the mod of a very large integer with a normal small integer. I recently encountered this problem when I needed to compute the modulus of a very large number with...
5
by: Mark A | last post by:
I have an OLTP database that has a tablespace that will start out at about 1 TB, but may grow to 75 TB's in size over the next 5 years. When I add new containers (on a new mount point), I want to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
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...
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...

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.