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 MaruthiRank #937 · 2.2K reputationPosted Aug 8, 2014, 7:34 AM EDT
{
alert("Max is should be greater than min");
}
else
{
return false;;
}
once look at this link:
http://www.w3resource.com/javascript/statements/ifelse.php
Prasad BhagatRank #3,426 · 422 reputationPosted Aug 8, 2014, 9:27 PM EDT
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
Prasad BhagatRank #3,426 · 422 reputationPosted Aug 8, 2014, 9:42 PM EDT
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
Ramesh MaruthiRank #937 · 2.2K reputationPosted Aug 9, 2014, 10:20 AM EDT
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeFile="Home.aspx.cs" Inherits="_Default" %>