Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write a code for "RequiredFieldValidator" in java script

Answer Posted / rajikiran

function validate()
{
if(document.getElementById("NameId").value == null)
alert("Please enter the name");
document.getElementById("NameId").focus();
return false;
}

or

function validate()
{
with(document.formname)
{
txtboxid.value == ""
alert("Please enter value");
txtboxid.focus();
return false;
}
}

or we can use

document.form.txtboxid.value

instead of

document.getElementById("NameId").value


regards
rajikiran

Is This Answer Correct ?    7 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Briefly describe the role of global.asax?

939


What are tuples?

1051


What is session management in web application?

975


What is the function of new view engine in asp.net? : asp.net mvc

962


What language is asp.net written in?

1002


What is asp.net mvc? : asp.net mvc

1054


Explain the advantages of asp.net.

949


What is the use of session?

895


What is base class of .net?

919


If I have more than one version of one assemblies, then how will I use old version (how/where to specify version number?) In my application?

965


Does google crawl redirects?

922


What are the new web part controls in asp.net 2.0 ?

981


What are the different types of validation controls in asp.net?

1000


What is the full form of asp.net?

981


How will you load dynamic assembly? How will create assesblies at run time?

894