Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old April 16th, 2004, 05:03 PM
vikaspa vikaspa is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 99 vikaspa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 4 m 45 sec
Reputation Power: 2
How to twrminate a function

I AM CALLING A FUNCTION THAT CALLS A FUNCTION TO VALIDATES FOR A CONDITION

AND I WANT TO CERTAIN THINGS TO DO ONLY IF THE VALIDATION IS TRUE


MY PROBLEM IS I CAN WRITE THE CONDITION BUT I AM NOT SURE OF 'CLOSING THE FUNCTION;

EXAMPLE

GIVEN BELOW IS MAIN FUNCTION

function doAddContinue()
{
if ( verifyentry(addcntr) ) // CALLING verifyentry FUNCTION
{
alert(" True condition ");
}
else
{ break; }
// IF I CHOOSE TO WRITE THIS WAY IS IT CORRECT ?

add2Table();
// WANT TO CALL ONLY IF THE verifyentry RETURNS TRUE
}


FOLLOWING FUNCTION IS CALLED
function verifyentry(cntr)
{
var vline=true;
if (document.f1.line_size_dummy.value == "select from list")
{
alert("Incomplete information ...please select the Line");
document.f1.line_size_dummy.focus();
return false;
break;

}

I WANT TO ASK
1. IS IT NECESSARY TO HAVE
return false;
break;

THESE 2 SENTENSES ?


THANKS IN ADVANCE

Reply With Quote
  #2  
Old April 16th, 2004, 05:22 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: How to twrminate a function

keep the break in the doaddcontinue function and only use return false in the second function.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > How to twrminate a function


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT