A better solution for what you're doing is to leave the button as
type=submit and remove its onclick event. Instead, add an onsubmit
handler to form that calls return validateForm() - return false in your
function when validation fails.
HTH,
Matt
-Original Message-
From: epyonne
Hi There,
Why dont you change the button back to a submit and then add a
onSubmit='return validation();' to you form ?
Thats what we do
Eg.
Script
function valid () {
if (document.form.val.value.length 1) {
alert(Please enter a value);
Most likely document.form1 is not visible in the browser object model.
There are various ways to address the form, but the most portable in this
case is probably document.forms[0].
Chris
-Original Message-
From: epyonne [mailto:[EMAIL PROTECTED]
Sent: 21 October 2003 16:35
To: Tomcat
]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Tuesday, October 21, 2003 10:45 AM
Subject: RE: JSP question
Most likely document.form1 is not visible in the browser object model.
There are various ways to address the form, but the most portable in this
case is probably document.forms[0
Thank you Matt and Peter for the suggestion. It works!!!
- Original Message -
From: Peter Guyatt [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, October 21, 2003 10:42 AM
Subject: RE: JSP question
Hi There,
Why dont you change the button back to a submit
works fine written this way :
html
head
titleblah blah blah/title
link rel=stylesheet href=css/standard.css type=text/css
/head
body
script LANGUAGE=JavaScript
function validateForm(){
if(document.form1.ani.value == ){
alert(Please enter an ANI);
return;
}
document.form1.submit();
}
-Original Message-
From: Luc Foisy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 08, 2003 1:54 PM
To: Tomcat User List (E-mail)
Subject: JSP Question
I am trying to use %@ include file=filename %
I am sending to the page that has this with the line:
I may be referring to an oldschool version of tomcat but the include
directive occurs during compilation, not execution. So to do what you want
you'd have to say
% if(goo){%
%@ include file=filenameA %
% }else{ %
%@ include file=filenameB %
% } %
or
do your thing
pages based on
applicationJar.getPageName() instead of including dynamic content in a common page
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 08, 2003 3:16 PM
To: [EMAIL PROTECTED]
Subject: RE: JSP Question
I may be referring
Assuming you have a controller servlet that could load
the hint text from the database, why not have a static
hashtable in your servlet code that is initialized with
the values from the database in the init() method. Then
as each session is initialized, you could put a reference
to the hashtable
http://www.servlets.com/cos/index.html
These classes will get you the upload part.
-Original Message-
From: Magnus Jansson [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 9:20 AM
To: [EMAIL PROTECTED]
Subject: OT: jsp question about uploading images to a database
I want to
Two quick ideas:
1. Include in each of your forms a html hidden tag that has a name value
that will be common for each form, and a value dependent on the identity of
the form. Then you can get from the request object the expected key value
and find the form.
input type=hidden
12 matches
Mail list logo