Click here to Skip to main content
15,903,175 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi ,
i have 3 values
a=5 ; b=2 ;c ="3"
This three are edit-for Int text box in asp.net MVC ,

i need validation logic i.e b or c never bigger than a but in second condition it important that b+c must be = a
a=5 ;b=5; c=0 its true
or
a=5 ;b =4 ;c =1 its true

but

a =5 ;b=2 and c = 2 =false

how i create this > and < logic with j query and asp.net MVC vs2017

What I have tried:

$(function () {
			$("#Contenor_Qty", "#Contenor_20", "#Contenor_40").change(function () {
				var contQt = ($("#Contenor_Qty").val());
				var cont20 = ($("#Contenor_20").val());
				var cont40 = ($("#Contenor_40").val());
				if (contQt !== "") {
					if (cont20 !== "") {
						if (cont20 <= contQt) {
							return true;
						}
						
					}
				}
			});
		
		}); 
Posted
Updated 21-Jan-19 9:00am

1 solution

In short:
C#
correct= (b <= a) && (c <= a) && ((b + c) == a))
 
Share this answer
 
v3
Comments
Maciej Los 21-Jan-19 16:33pm    
I love such of short answers.
[no name] 22-Jan-19 2:51am    
Thank you Maciej.
yogesh vaidya 23-Jan-19 12:15pm    
thanks 0x01AA
yogesh vaidya 23-Jan-19 12:14pm    
thanks Maciej Los

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900