GTU WTAD Practical 3 : Create a Form in HTML with two fields, minimum and maximum, write JavaScript to validate that only numeric value is entered in both, and the value entered in minimum is less than the value entered in maximum

GTU WTAD Practical 3 : Create a Form in HTML with two fields, minimum and maximum, write JavaScript to validate that only numeric value is entered in both, and the value entered in minimum is less than the value entered in maximum.

GTU WTAD Practical 3

In this example user will enter number1 and number2 in the appropriate textbox, using JavaScript code i will check out that which number is maximum and which one is minimum and will display message to the user.

File Name : index.jsp

File Location : Tomcat_Apache\webapps\gtu03\

 

output

GTU WTAD Practical 3

 

JavaScript Conversion functions.

  • Number() : this method is used to convert data into Number
  • parsetInt() : this method is used to convert data into integer type of number
  • parseFloat() : this method is used to convert data into Float type of number.
  • valueOf() : this method is used to convert string to number.

 

How to Generate Random Number between 0 to 99 in JavaScript ?

Math.random() * 100;

 

How to create Date Variable in JavaScript ?

In JavaScript date is calculated in miliseconds, but you can use following constructor to create date object. be sure to assign month -1 as month is value is considered as index value (possible values : 0 – 11)

 

How to extract day, month, year, hour, minute and second from data using JavaScript ?

Adarsh Patel

My Self Adarsh Suryakant Patel. Currently I am working as Assistant Professor at Parul Instiute of Engineering and Technology, MCA Department, Limda, Vadodara. Major Responsibility : * Lectures * Organizing Training and Expert Sessions for * Placement and Recruitment * Faculty Representative