473,503 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validate textbox - integer product cannot be divisible by 7

3 New Member
Hey Guys, I'm trying figure out how to write a JavaScript for a textbox that contains an integer not divisible by 7.

My aspx form has two textboxes (for integers) and a button (multiply). I have to write a javascript for the CustomOperation for the client-side. The product can not be divisible by 7.

Any info is helpful
Jul 6 '07 #1
7 3137
Qdiddy34
3 New Member
Hey Guys, I'm trying figure out how to write a JavaScript for a textbox that contains an integer not divisible by 7.

My aspx form has two textboxes (for integers) and a button (multiply). I have to write a javascript for the CustomOperation for the client-side. The product can not be divisible by 7.

Any info is helpful
Jul 6 '07 #2
acoder
16,027 Recognized Expert Moderator MVP
Moved from the Articles section.

Also, changed the thread title.
Jul 6 '07 #3
Qdiddy34
3 New Member
Moved from the Articles section.

Also, changed the thread title.
I am aware of that but need JavaScript code to for it.
this is what I have:
<Script language = JavaScript>

function multiply()
{
A = document.frmOne.txtFirstNumber.value
B = document.frmOne.txtSecondNumber.value
C = (A * B)

document.frmOne.txtThirdNumber.value = C
}
Jul 6 '07 #4
epots9
1,351 Recognized Expert Top Contributor
I am aware of that but need JavaScript code to for it.
this is what I have:
<Script language = JavaScript>

function multiply()
{
A = document.frmOne.txtFirstNumber.value
B = document.frmOne.txtSecondNumber.value
C = (A * B)

document.frmOne.txtThirdNumber.value = C
}
continuing from your code:
Expand|Select|Wrap|Line Numbers
  1. var d = C % 7;
  2. if(d == 0)
  3. {
  4. //code for it being divisible by 7
  5. }
  6. else
  7. {
  8. //code for it not being disvisible by 7
  9. }
  10.  
give that a shot
Jul 6 '07 #5
JosAH
11,448 Recognized Expert MVP
You're talking JavaScript right? This is a Java forum and Java has nothing to do
with JavaScript. Do you want me to move your question to a more appropriate
JavaScript forum?

kind regards,

Jos
Jul 6 '07 #6
r035198x
13,262 MVP
You're talking JavaScript right? This is a Java forum and Java has nothing to do
with JavaScript. Do you want me to move your question to a more appropriate
JavaScript forum?

kind regards,

Jos
I'll take the silence as a yes and so I've moved it.
Jul 7 '07 #7
acoder
16,027 Recognized Expert Moderator MVP
Merged threads.
Jul 7 '07 #8

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

Similar topics

15
4786
by: simonmarkjones | last post by:
I want to validate my form using a BeforeUpdate event. However now that i call my code with a beforeupdate it wont let me go to next or previous records. What code should i put in o allow me...
14
10043
by: tlyczko | last post by:
I am looking to validate time worked in quarter-hour increments, e.g. ..25, .5, .75, 1.0, etc. etc. I know I can use a modulo statement for the evaluation but I could not find an explanation of...
2
1607
by: Gary Vidal | last post by:
I have a shopping cart webpage that shows a product and the Quantity they would like to order: When you click the link I want to take the quantity that they entered in the textbox and post that to...
5
2617
by: Jeff Evans | last post by:
I have a custom composite control which has a validator for a textbox. The validator and textbox are declared in the class and created in the CreateChildControls() method Here is the code for the...
0
2070
by: suresh | last post by:
How to validate input with datagrid control? i tried the following code from msdn...i have problem in adding handler to the columnchanging event..its not working for me? any bug in this code? is...
2
2473
by: Scott Emick | last post by:
I cannot remember how to enable the vertical scrollbar in my textbox for which I've added combobox controls to dynamically. I have the vertical scrollbar turned on, but it is greyed out and I...
7
4966
by: whodgson | last post by:
The following code does everthing required except that because each numeral of the integer has to be entered individually the numbers appear in a vertical column. Question: is there a way of entering...
1
6293
by: JFKJr | last post by:
Hello everyone, the following Access VBA code opens an excel file and creates textboxes in a given range of cells dynamically. The code attaches "MouseUP" and "Exit" events to the textboxes (using...
1
2446
by: rakeshnair | last post by:
i wrote a code in jsp to create dynamic table..the problem is i need data base connection when cursor moves from one cell to other... eg...when i enter product id in the first cell, the product name...
0
7202
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
7084
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...
0
7278
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
7328
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...
1
6991
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
5578
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
3167
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
1512
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 ...
0
380
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.