javascript return flase

Asked By srikar
09-Sep-10 04:07 AM
Earn up to 0 extra points for answering this tough question.
javascript return flase waht it's do. wht is the necessity of it.

  re: javascript return flase

Santhosh N replied to srikar
09-Sep-10 04:09 AM
Whenever you require to get any boolean result from a function you could use that..especially in validation functions this reurn false will be used

  re: javascript return flase

Super Man replied to srikar
09-Sep-10 04:17 AM

You can use this to test any condition.

If test returns then something is to execute.

Else do nothing or execute something else.

 

 

  re: javascript return flase

Sagar P replied to srikar
09-Sep-10 04:22 AM
Actually its very useful in validations.... Like if you want user to only enter numbers in textbox then you can write JS function which will return true or false depedning on entered character... and you can use it for text box like;

txtNumbers.Attributes.Add("onkeypress","return OnlyNumbers()");

So it will not handle keypress event if its return false...... it will not enter that char at all in text box....

Same way if you dont want to refresh a page onclick on button you can use it like;

btn.Attributes.Add("onclientclick","return false;")
  re: javascript return flase
Anand Malli replied to srikar
09-Sep-10 05:51 AM
Hi Sriakr,

Return false suppress the original event of your control ,say you have button and onclientclick is also there and onclick is also there so if your javascript function return false your server side event will never get fired,so now to make it fire you will need to rerun true

i think you got the point
Thanks
  re: javascript return flase
[ Kirtan ] replied to srikar
09-Sep-10 05:11 PM
You have not mentioned what code returns false . still i m trying to give answer

False / True are boolean values that some time taken as 1 and 0 also they are written in java script for indicating success or failure / some other type of condition inside code of java script
  re: javascript return flase
Goniey N replied to srikar
10-Sep-10 01:40 AM
-- First Of I Want To Say That There Is One Datatype Which Return Either "True" Or "False".

-- Means When You need This Kind Of True Or False Return Type Then You Can Use This Type As Return Type.


-- Let's Take One Example :

01.<script type="text/javascript">
02.  function My(Name)
03.  {
04.    if(Name == 'EggHeadCafe')
05.      //If Given "Name" Is "EggHeadCafe" Then It Will Return True...
06.      return True;
07.    else
08.      //Else Return False...
09.      return False;
10.  }
11.</script>
12. 
13.//Here On Button Click Event It Will Call The Function
14.<asp:Button ID="button1" Text="Check" runat="server" OnClick="button1_Click" OnClientClick="return My('EggHeadCafe');"/>


-- Depending On Your Condition It Will Return Either "True" Or "False"....

-- Hope This Will Helpful To You...
Create New Account
Frequently asked Interview Questions in ADO.Net hi friends Any one send frequently asked Important questions in C# .Net, ADO .Net, Asp .Net and Sql Server. . . . . . . . tx in Advance. . . . . . Hi, Find this. . (B Boxing and Unboxing ? (B) What is the difference between VB.NET and C#? (I) what is the difference between System exceptions What is a satellite assembly? (A) How to prevent my .NET DLL to be decompiled? (I) what is the difference between we make a choice? (A)What is CodeDom? Chapter 2: NET Interoperability (I) How can we use COM Components in .NET? (I) We have developed the COM wrapper do we have to still register the COM? (A)How can we use .NET components in COM? (A) How can we make Windows API
Pop up window using AJAX in ASP.NET Pop up window using AJAX in ASP.NET Refer: http: / / www.asp.net / ajax / ajaxcontroltoolkit / Samples / PopupControl / PopupControl.aspx Untitled document < cc1 : ModalPopupExtender PopupControlID = "Panel1" CancelControlID = "LinkButton4" PopupDragHandleControlID = "btnMsg" ID = "ModalPopupExtender2" runat = "server" / > < asp : Button ID = " Button3 " runat = "server" Text = "Take Input" / > < asp : Panel ID = "Panel1" runat = "server" Height = "80" CssClass = "ModalWindow"> <% - -Take textboxes here- - %> < asp : LinkButton ID = " LinkButton4 " runat = "server" Text = "X" / > Records updated < / asp
ASP.NET WEB application deployment Hello sir, I am new to ASP.NET development. I have a doubt in deployment of a ASP.NET application on a web server. It is specified that this webserver supports ASP.NET. I have developed an ASP.NET application using Visual studio. I have a form in which
Life Cycle Want to know about the Life cycle of ASP.net page ASP.NET 2.0 Page Life Cycle - The lifetime of an ASP.NET page is filled with events. A series of processing steps the page life cycle starts. Whenever a page is requested, ASP.NET detects whether the page is to be requested, parsed and Control Events - These are the control specific events, such as button clicks, listbox item selects etc. LoadComplete - To execute tasks that each control of the page. This actually means that the ASP.NET server control's HTML markup is sent to the
Interview Questions for .NET Framework This article is specially for the users those are in development or want to be a .net developer • To test a Web Service you must create a is True / False? FALSE How many classes can a single.NET DLL contain? Answer1: As many Answer2: One or more What are good ADO.NET object(s) to replace the ADO Recordset object? The differences in-memory representation of data is the recordset. In ADO.net, it is the dataset A recordset looks like a single is a collection of one or more tables in ADO.net ADO is designed primarily for connected access ADO.net the disconnected access to the database is used In ADO by making calls to an OLE DB provider. In ADO.NET you communicate with the database through a data adapter (an ADO you cant update the database from the recordset. ADO.NET the data adapter allows you to control how the changes which it occurs. Example a. Static int var / / in c#.net b. static void Time( ) / / in c#.net How do you
ASP.NET 2.0 Data Control Series The intent of this series more information concerning the functionality and limitations of the available ASP.NET 2.0 data controls. This will mostly be demonstrated through address the basics first before moving onto more advanced tools. ASP.NET 2.0 Data Controls Author: Douglas Minnaar The intent of more information concerning the functionality and limitations of the available ASP.NET 2.0 data controls. This will mostly be demonstrated through scenarios that one might encounter in terms of developing with ASP.NET data controls. There will be three parts in this series
all, can anybody tell me the FAQs on Masterpages in asp.net. Thanks alot var Hi What are Master Pages in ASP.NET? or What is a Master Page? ASP.NET master pages allow you to create a consistent layout for s configuration file (Web.config), you can specify that all ASP.NET pages (.aspx files) in the application automatically bind to a folder only. The master-page bindings then apply to the ASP.NET pages in that folder. What is @MasterType directive used for
ASP.NET: Integrating Customized Roles, Membership and Profiles in ASP.NET 4.0 There is a lot of material on ASP.NET Membership Providers, some about Roles, and even less on Profile required database information on a hosted site, and even an ASP.NET "SetupASPNETDatabase.aspx" page that does all this programmatically - something many about anything you would expect to need to perform in ASP.NET for a site, using all three providers - Membership, Role, and