× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I am going to remove the Submit button. Also when some one clicks on a
selection from the category list, it will automatically update the sub
category list to correspond with the categories. That is why I did it
this way.

-----Original Message-----
From: web400-admin@midrange.com [mailto:web400-admin@midrange.com] On
Behalf Of Erik Mitsch
Sent: Friday, June 28, 2002 8:34 AM
To: web400@midrange.com
Subject: RE: [WEB400] JavaScript Submit Form

Hey Justin,

I bring this up since you have a submit button there already - why is it
necessary that the form submits as soon as one option is chosen?  Why
not
just use a standard pulldown menu, and submit with a button?  You're
assuming that someone isn't going to make a mistake if you do it the way
you
have it.  However, if you want to do it that way, take a look at the
OnChange event rather than OnClick - I'm fairly certain that pulldown
menu
items can't use the OnClick event.  OnChange applies to the whole menu,
and
will perform the action as soon as the menu changes.  This means you
should
add a "blank" menu option as your original selected item (which reminds
me,
you have both sub-category options marked as selected -

--
<STRONG>Sub Category: </STRONG><SELECT size=1 name=SUB>
            <OPTION value="AGP" Selected <----------------------
"OnClick:submitForm()">AGP</OPTION>
            <OPTION value="PCI" Selected <----------------------
"OnClick:submitForm()">PCI</OPTION>
            </SELECT>
--

Here's how to do it with OnChange, best I can figure:

<select size=1 name=SUB OnChange="submitForm()">
<option SELECTED>Choose a Sub-Category</option>
<option value="AGP">AGP</option>
<option value="PCI">PCI</option>
</select>
<noscript>
<input type="submit" name="submit" value="Click to Submit">
</noscript>

That <noscript> portion allows for people who don't have browsers
supporting
JavaScript, or have that capability shut off for some reason.  It will
only
add the submit button in that case.

That should help out a bit!

- Erik
http://www.baron-inc.net


_______________________________________________
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/web400
or email: WEB400-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.