CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Java

 submit once and validate

Print topic Send  topic

Author Message
mthompo

Posts: 2
Posted: 07/24/2007, 2:23 AM

hi,

am having trouble getting these two functions to work together,

one does the form validation
  
function  EW_checkMyForm(EW_this) {  
if (EW_this.x_stockreg && !EW_hasValue(EW_this.x_stockreg, "TEXT" )) {  
            if (!EW_onError(EW_this, EW_this.x_stockreg, "TEXT", ">Please Enter Car Reg..."))  
                return false;   
        }  
return true;  
}  

and this one stops the form from being submitted twice

  
var submitcount=0;  
  
function submitonce() {         
   if (submitcount == 0)  
      {  
      submitcount++;  
      return true;  
      }  
   else   
      {  
      alert("This form has already been submitted.  Thanks!");  
      return false;  
      }  
   }  

they are run onsubmit of the form

  
<form action= "custaddmot.asp" name="custaddmot" id="custaddmot" method="post" onSubmit="return EW_checkMyForm(this);return submitonce()">  

any ideas appreciated - i am new to javascript
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.