Dear all ,
the onBlur event in content pages not working properly
please look at my code but
i have one question how to call second condition on that
its always printing only one value
function validate() {
debugger;
var txt1 = document.getElementById('<%= txtminsal.ClientID %>');
var txt2 = document.getElementById('<%= txtmaxsal.ClientID %>');
txt2 >txt1
alert("Max is should be greater than min");
return false;
}
debugger;
var txt1 = document.getElementById('<%= txtminsal.ClientID %>');
var txt2 = document.getElementById('<%= txtmaxsal.ClientID %>');
txt2 >txt1
alert("Max is should be greater than min");
return false;
}
please tell me the reson if my condition true then show the alert
if my condition is false i dont want to show the alert

Ramesh MaruthiPosted Aug 9, 2014, 2:20 PM
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeFile="Home.aspx.cs" Inherits="_Default" %>
Prasad BhagatPosted Aug 9, 2014, 1:42 AM
iam tring with two asp.net textboxes(txtminsalary,txtmaxsalary) inside content page
i want to write a javascript function for validate for maxsalary always greater then minsalary
if i enter max saalry i want to disply alert message sir
iam using OnBlur event for that sir
debugger;
var txt1 = document.getElementById('<%= txtminsal.ClientID %>');
var txt2 = document.getElementById('<%= txtmaxsal.ClientID %>');
txt2 >txt1
alert("Max is should be greater than min");
return false;
}
if possible help me
Prasad BhagatPosted Aug 9, 2014, 1:27 AM
thanks for reply ,
my code inside the content page not in nomal web form
in this code was not executing and also not firing the event sir
Ramesh MaruthiPosted Aug 8, 2014, 11:34 AM
{
alert("Max is should be greater than min");
}
else
{
return false;;
}
once look at this link:
http://www.w3resource.com/javascript/statements/ifelse.php