[thelist] JavaScript - form.submit()

Jeff Howden jeff at members.evolt
Tue Aug 1 12:43:56 CDT 2000


scott,

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: From: <Scott_Brady at themoneystore.com>
:
: Thanks, Jeff!  That seemed to work.
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

good.  it always does for me and i've built a ton of administrative tools
that do form validation on everything.  this is how i learned to do it after
unable to get the onClick in an image submit to work or using the submit()
method.  after finally settling in with the using the onSubmit event
handler,l form validation has become just routine - no difficulties
whatsoever.

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: The method I was using (doing a form.submit() in
: the Javascript, but putting a "return false;" in the
: onSubmit) was what I was taught in a JavaScript
: class about a year ago.
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

there's always more than one way to do something.  there's usually one that
stands above the rest though.  that's the case with this.  there are still
alot of people that are teaching the use of the submit() method cause, at
first, it's easier to learn.

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: Aside from the fact that it didn't work this time (but has
: worked all the other times I've used it), what is wrong
: with using submit()?  From a browser issue, we're on
: an intranet, and we only support IE4+ and our network
: is set up so that users can't disable scripting, so we don't
: have to worry about compatibility problems.
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

intranet job or not, do you suppose you'll be working there or on an
intranet forever?  didn't think so.  since using the onSubmit event handler
as i suggested works just as well why not learn to do form validation in a
fashion that you can use out in the wild?  that's my take on it.

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: If I didn't like the way the ugly grey buttons look and wanted
: to use an image as a submit button, wouldn't I have use the
: submit() function? (I generally stick with the ugly buttons, so
: that situation hasn't come up with me yet)
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

nope.  there's something called an image submit that doesn't require you to
do anything fancy.

<input
  type="image"
  name="submit"
  src="images/submit.gif"
  alt="Click to Submit"
  width="75"
  height="25"
  border="0"
  accesskey="s">

if you need more than one graphical submit button then there are solutions
to that problem as well (which i won't describe here).

good luck,

.jeff

name://jeff.howden
game://web.development
http://www.evolt.org/
mailto:jeff at members.evolt.org







More information about the thelist mailing list