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

Differentiate between structure and class.

1015


Is asp net front end or backend?

998


What does asp.net stand for?

1123


What do you understand by aggregate dependency?

1087


Is it possible to apply themes to an asp.net application? If yes, then how?

1011


What are tuples?

1126


In which event of page cycle is the viewstate available?

1012


Who generates session id?

936


What is the server of asp.net?

1072


What do you mean by marshalbyref?

1095


What is the differences between a primary key and a unique key in sql server?

1075


What is the behavior of a Web browser when it receives an invalid element?

1109


What are the main differences between asp and asp.net?

1036


Explain the difference between Repeater and Data list control in ASP.NET?

1094


Why we go for mvc instead of asp.net? : Asp.Net MVC

1054