Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JavaScriptQuestions request this program
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


kathiravan
request this program
1 Answer(s)      3 years and 5 months 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


Advertisement
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>


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
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
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
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
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
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
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
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
Ajax request object
Ajax request object  i have to open more than one time a same jsp page with same input using Ajax.. But it will be opened only one time. i can open If i give different input.. how to solve this problem
Request for codes - JSP-Servlet
Request for codes  Sir , I am an engineering student i am interested in learning JAVA also i need some example code for creating Registration form codes for creating web based application using JSP sir plz send me which
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
Configure Js request in Web.xml
Configure Js request in Web.xml  Hi all, I have 1 basic doubt,suppose i have 2 jsp,1 servlet,1 web.xml file.i need to redirect 1 page via servlet with help of web.xml file.Here just i need to redirect to mainCtrl.java
Problem in request object
Problem in request object  I have created a form where I have file...=null; String description=null; String path1=null; out.println(request); path1...(); int update=0; boolean isMultipart = ServletFileUpload.isMultipartContent(request
Problem in request Object
Problem in request Object  I have created a form where I have file input along with other inputs. I am using jsp to process the inputs. File input is not processing while the rest of the data is being processed.Please Help me out
JSP Request Dispatcher
JSP Request Dispatcher   ... the RequestDispatcher class to transfer the current request to another jsp page. You can... transfers the request using the getRequestDispatcher("/form.jsp"
How to send HTTP request in java?
How to send HTTP request in java?  How to send HTTP request in java
Request Headers in JSP
Request Headers in JSP          Whenever an http client sends a request, it sends the request in the form of get or post method or any other HttpRequest 
request header and response - Java Beginners
request header and response  count the hits of a user on a site
Pinting restful webservice request on UI.
Pinting restful webservice request on UI.  I want to print request XML for Restful webservice request in my UI application in swing. When a user clicks on xml request button, he/she sees xml request on the UI. I could print xml
simple ajax Request and Response code...
simple ajax Request and Response code...  var request=null; if (window.XMLHttpRequest) { request = new XMLHttpRequest(); } else if (window.ActiveXObject) { request = new ActiveXObject("Microsoft.XMLHTTP"); } if(request
request header and response - JSP-Servlet
request header and response  Create aservlet that redirects a client to a.html if its morning ,to b.html if its a afternoon else to c.html.
Request Headers In EL
Request Headers In EL          Whenever an http client sends a request... in scripting. To access the request headers we need a simple trick, by using
Specific Request Headers in JSP
Specific Request Headers in JSP          Whenever an http client sends a request... to retrieve some of the headers available in the request object. We
request dispatcher - Java Interview Questions
request dispatcher  what is the getrequestdispatcher... RequestDispatcher getRequestDispatcher(java.lang.String uri) Returns a request dispatcher..."); disp.include(request, response); ServletRequest to return a request
Advertisements
 

 

 

DMCA.com