hai everybody
am new to jsp am using following code to check the value entered in text box with some maximum value. if it's greater then the maximum value i need to display error div instead of alert box.please help me.

var max=document.getElementById("max");
if(max.value !=" " && max.value !=null && max.value !="")
{
if( val >= max1 )
{
alert("max1");

}

}

Thank you.....

create a <div class="errorBox" (or id="errorBox" >
</div>

add a textcomponent in there with no text in it.
as a default, you'll set the visible:false in the css for that div (class or id)
and when you have an errormessage to show, you set the value to true, and set the text of the textcomponent to the errormessage.

hai
thank you. it's help me lot......

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.