Go Back   Forums > Community Chatterbox > Tech Corner > Programming
Memberlist Forum Rules Today's Posts
Search Forums:
Click here to use Advanced Search

Reply
 
Thread Tools Display Modes
Old 20-05-2011, 04:58 PM   #1
Ohne Mitleid
Brazen Pangolin
 
Ohne Mitleid's Avatar


 
Join Date: Dec 2010
Location: ,
Posts: 202
Default

Code:
function validateForm(myForm)
{
if (failure conditions)
  {
  show error message;
  return false;
  }
}

<form onsubmit="return validateForm(this);"></form>
This is the modified code from the first example. Follow the logic. There is no need for the return true. Onsubmit sends the input data to the validateForm function. The function initially checks for failure conditioins. If it fails, the error message is displayed, a false conditions response is returned and your code should be set up to continue looping until a return false response is not returned. If the function were to get past the failure conditions, it is assumed to be a success (return true).

At least that's how I understand it.
Ohne Mitleid is offline                         Send a private message to Ohne Mitleid
Reply With Quote
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript help? Maxor127 Programming 1 08-10-2009 06:30 AM
Something weird with JavaScript The Fifth Horseman Programming 2 15-07-2009 08:08 PM
Javascript And Firefox Abi79 Tech Corner 3 09-04-2006 05:53 AM


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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump
 


The current time is 09:29 AM (GMT)

 
Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.