Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

request this program

Ads

 
 

Share on Google+Share on Google+

kathiravan
request this program
1 Answer(s)      6 years and a month ago
Posted in : JavaScript Questions

if three text box value in my program i want to check the three input boxes values and display greatest two values

Ads
View Answers

July 22, 2011 at 12:08 PM


<html>
<script>
function check(){
    var n1=document.getElementById("num1").value;
    var n2=document.getElementById("num2").value;
    var n3=document.getElementById("num3").value;

    if((!isNaN(n1))&&(!isNaN(n2))&&(!isNaN(n3))){
        var num1=parseInt(n1);
        var num2=parseInt(n2);
        var num3=parseInt(n3);
        var secondhighest;
        var highest=Math.max(num1,num2,num3);
        if(highest==num1){
           secondhighest=Math.max(num2,num3);
        }
        if(highest==num2){
           secondhighest=Math.max(num1,num3);
        }
        if(highest==num3){
           secondhighest=Math.max(num1,num2);
        }
        alert("Greatest Number: "+highest+" and Second Greatest Number: "+secondhighest);
    }
    else{
    alert("Entered values are not an integer!");
    var n1=document.getElementById("num1").value=" ";
    var n2=document.getElementById("num2").value=" ";
    var n3=document.getElementById("num3").value=" ";
    }
}
</script>
<table>
<tr><td>Enter Number1</td><td><input type="text" id="num1"></td></tr>
<tr><td>Enter Number2</td><td><input type="text" id="num2"></td></tr>
<tr><td>Enter Number3</td><td><input type="text" id="num3"></td></tr>
<tr><td></td><td><input type="button" value="Check" onclick="check();"></td></tr>
</html>

Ads









Related Tutorials/Questions & Answers:
request this program
request this program  if three text box value in my program i want to check the three input boxes values and display greatest two values
Request Parameters in JSP
Request Parameters in JSP       In this section, you will study about the various request parameters. HttpServletRequest interface is responsible for providing request
Advertisements
How to send the request and get the request?
How to send the request and get the request?  how to send a request to a JSP file in another domain in the same server and get the request done i.e how to include JSP file of one domain to another doamin JSP within in the same
request to help
request to help   how to write the program for the following details in java Employee Information System An organization maintains the following data about each employee. Employee Class Fields: int Employee ID String Name
request processing in servlets
request processing in servlets  how request processing is done in servlets and jsp   Please visit the following links: JSP Tutorials Servlet Tutorials Here, you will find several examples of processing request
jsp request in struts1
jsp request in struts1  how the request for a JSp is processed in Struts1?Any JsP page in the end a servlet only.where is the URL pattern for this servlet
How to send NSURLConnection synchronous request on https?
How to send NSURLConnection synchronous request on https?  Hi, Give me program example of NSURLConnection synchronous request on https. Thanks
program
program  any program of hotel or school management
JSP Request Object
JSP Request Object  JSP Request Object ?   request object... an HTTP request. The request object is used to take the value from the client?s web browser and pass it to the server. This is performed using an HTTP request
program
program  program of jdbc using ms access for creating table
program
program  write a javascript program to create a application form with validation
program
program  write a html program in show table and this word in box
program
program  write a program different between to dates in terms of days in java
request object - JSP-Servlet
request object  What is Difference Between request.getHeader("x-forwarded-for") and request.getServerName() pls give me reply as soon as possible
program
program   Write a program to find the difference between sum of the squares and the square of the sums of n numbers
program
program  develop a servlet to insert the data in the database from our program in the table stored in the database
program
program  write a program reversee a string. input-hi this is roseindia output-roseindia is this hi
program
program  WAP a java program to form 1/2+3/4+5/6+7/8 series
jQuery Ajax load request
jQuery Ajax load request  Hi, How to use jQuery to send the request on server to load data in web page? Thanks   Hi, In the jQuery Load Content tutorial you will find the code example to send request on server
Session Object from request
request object? Why are we adding cookie object into response object? Why are we getting cookie object from request object? I know all methods are available its relevant class. is there any reason for getting session object from request
request object value
request object value  Hi Friends I am developing a web application... request object value for whole application. Problem is..envirement session... request value for whole application without using session,application object. Please
The $_Request Function
The $_Request Function The contents of both $_GET, $_POST, and $_COOKIE are contained by the PHP built-in $_REQUEST function. $_REQUEST Method is used...;?php echo $_REQUEST["name"]; ?><br /> Address :<?php echo
program
program   An old-style movie theater has a simple profit program. Each customer pays $5 per ticket. Every performance costs the theater $20, plus $.50 per attendee. Develop the program calculateTotalProfit that consumes
program
program  explanation of program on extending thread class   Hi Friend, Please go through the following link: Java Threads Thanks
program
program  Develop the program calculateCylinderArea, which accepts radius of the cylinder's base disk and its height and computes surface area of the cylinder
program
program  write a java program to input a no. and print wheather the no. is a special no or not. (special no. are those no whose factorial of the sum of digit of the no is same as the original
JMeter HTTP request example
JMeter HTTP request example  Concerning: http://www.roseindia.net/jmeter/using-jmeter.shtml how do I set path? also what do i need to do to get the helloworld servlet work? Thanks in advance
request for java source code
request for java source code  I need source code for graphical password using cued-click points enabled with sound signature in java and oracle 9i as soon as possible... Plz send to my mail
Request for Discussion forum in jsp
Request for Discussion forum in jsp  Hi i want discussion forum to my project. Can anyone tell me, what are all requirements needed to create it. THanks in advance
program
program  Develop a program that computes the distance a boat travels across a river, given the width of the river, the boat's speed perpendicular to the river, and the river's speed. Speed is distance/time, and the Pythagorean
program
program  how to improve programming skills plss tell some tips..i am understanding concepts but unable to write program so,pls give some guideness plsss