Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi All,


I really hope that someone can help me resolve my problem.I have an asp:label which gets its value from database, but what
I'm trying to do is to get that value (from the asp:label) and place it
inside the javascript and doing some validations.

in IE , it validate but in mozilla it doesnt validate .i give alert msg of alert(actualPrice ).In moziila the value is undefined but in IE it takes the value.

below is my code:
function OfferValidationMenuItem() 
{
	var OfferPrice = document.getElementById("<%=textboxOfferPrice.ClientID %>").value;
	var actualPrice = document.getElementById("<%=LabelDisplayItemPrice.ClientID %>").innerText;
	if (OfferPrice >= actualPrice)
	{
		alert("Offer Price must Less than Item Price");
		document.getElementById("<%=textboxOfferPrice.ClientID %>").focus();
		return false;
	}
}
Posted
Updated 22-Feb-12 21:24pm
v4

1 solution

C#
It will work if you use innerHTML
var actualPrice = document.getElementById("<%=LabelDisplayItemPrice.ClientID %>").innerHTML;
 
Share this answer
 
Comments
priya from Madras 23-Feb-12 4:20am    
ya i got the solution thanks sudip, but i already tried lik whatever u said ,before tat i was getting error, once i stop and rebuild my project it works , anyways thanks once again.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900