Login Form Validation/Automatic Submission

They have: 99 posts

Joined: May 1999

Driving myself a tad nuts on such a simple task....
I have a login form w/ username and password fields. Also have a smattering of hidden fields.

I would prefer to have an image button or an image link to perform a manual submit. I will use a standard submit button if I am forced to. The button is for those Browser types/versions that dont fall into the IE/NS 4.0+ category.

For those users w/ NS/IE 4.0+, I want to get the form to automatically submit when enter is pressed, but I also wish to validate the form has values in both fields prior to submission.
I can get explorer to perform with an image button, can not get Netscape. Has anyone got a simple example or examples for both Browsers....I can generate the html dynamically if I need different versions for each browser type.

Thanks for the assistance

Tazman

[This message has been edited by tazman (edited 27 March 2000).]

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

According to my huge book of HTML (a gift from my husband that I thought was going to be useless but has actually turned out to be quite handy -- Laura Lemay's learn HTML 4.0 in 14 days -- has a great appendix), the code you need is this:

<input type=image src="whatever.gif" name="submit">

Apparently this will be folded into the submit field in future versions of HTML, but otherwise, that's it. I'm not sure if adding the height and width in pixels will help, as the browser gets that info already...

hth,

Suzanne

------------------
Zero Cattle
Suzanne
Tables DeMystified

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi Taz,

This may confuse the matter even more, but...

Insofar as the validation (within both input tags):

onBlur="javascript:if(this.value != '' && this.form.otherfield.value !='') submitOK = true;"

Of course, the above implies that the images should call a submit function rather than be a simple submit.

I'm not sure how that would effect the "Enter" issue.

Vinny

------------------
GrassBlade: cut&paste javascript

Where the world once stood
the blades of grass cut me still

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.