Return-Path: Delivered-To: apmail-jakarta-struts-user-archive@www.apache.org Received: (qmail 38934 invoked from network); 20 Nov 2003 11:30:46 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 20 Nov 2003 11:30:46 -0000 Received: (qmail 11607 invoked by uid 500); 20 Nov 2003 11:30:29 -0000 Delivered-To: apmail-jakarta-struts-user-archive@jakarta.apache.org Received: (qmail 11575 invoked by uid 500); 20 Nov 2003 11:30:29 -0000 Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list struts-user@jakarta.apache.org Received: (qmail 11562 invoked from network); 20 Nov 2003 11:30:29 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 20 Nov 2003 11:30:29 -0000 Received: (qmail 38798 invoked by uid 1587); 20 Nov 2003 11:30:29 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 20 Nov 2003 11:30:29 -0000 Date: Thu, 20 Nov 2003 03:30:29 -0800 (PST) From: James Mitchell To: Struts Users Mailing List Subject: Re: URGENT :: Disable enter key in HTML:FORM by using onKeyPress func tion In-Reply-To: <8E8F90E0E0E3D71184BB00902785FCE13F5EE1@HPSB31EX57> Message-ID: <20031120031644.H12325@minotaur.apache.org> References: <8E8F90E0E0E3D71184BB00902785FCE13F5EE1@HPSB31EX57> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: localhost 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Thu, 20 Nov 2003, Chawla, Yogesh wrote: > Hi, > > In normal forms, we can disable enter key by calling onKeyPress() function > in the form tag. > However, this is not supported in the definition for Struts. > > Can anybody give a solution to this ... Your best bet for stopping the user from submitting a form with JavaScript is to handle it in the form tags onsubmit attribute. Here's an example from a recent app I'm working on: I needed a way to make sure that users entered a minimum of 3 (or some configurable value) characters when performing a search. The problem is that it can be 3 characters from any combination of 3 fields. ...and at the bottom of the page I do this... ...what that does is allow me to insert my own custom validation and, if that passes, then the validator-generated one is run. > > Thanks, > > Yogesh Chawla > DISCLAIMER: The information in this message is confidential and may be > legally privileged. It is intended solely for the addressee. Access to this > message by anyone else is unauthorised. If you are not the intended > recipient, any disclosure, copying, or distribution of the message, or any > action or omission taken by you in reliance on it, is prohibited and may be > unlawful. Please immediately contact the sender if you have received this > message in error. Thank you. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: struts-user-help@jakarta.apache.org > > -- James Mitchell Software Developer / Struts Evangelist http://www.struts-atlanta.org --------------------------------------------------------------------- To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: struts-user-help@jakarta.apache.org