Simple probably; javascript for form submission

Jim Skehill JimS-pFJmkVL1u50 at public.gmane.org
Tue May 24 16:37:08 UTC 2005


I forgo the use of the input tag with type submit. This becomes to hard to
manage when dealing with mutiple languages.
Instead I use something like this (this example is from my Login page):
   <form name="login"  action="/DocRoot/servlet/LoginServlet">		
		...
	<td align="center" background="/DocRoot/HTML/images/loginbttn.jpg" >
		<a href="javascript: doSubmit(document.login)" >
			Log In
		</a>
	</td>
		...
	</form>
Where
	1) loginbttn.jpg is the image of a blank button, i.e. no text
	2) doSubmit is a javascript routine that submits the form
	3) document.login is my form (I'm using the Document Object Model
(DOM) here)
	4) "Log In" is the text for what would be my submit button

I use an HTML table for my layout

Jim.
-----Original Message-----
From: linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org [mailto:linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org]
Sent: May 24, 2005 12:28 PM
To: tlug-lxSQFCZeNF4 at public.gmane.org
Subject: [TLUG]: Simple probably; javascript for form submission


Hi all,

  I am trying to do something I expect is relatively simple. So far though
all the stuff I've found on the web have been far more involved or
complex solutions than I need.

  Basically, in my web-based program I have several forms that need to be
submitted here and there. Currently I use '<input type="image"
src"...">' to keep the look the same. This works great. The problem is
now I am making my program translatable so the image that sayd, for
example, "Login" in english will look quite out of place if the user
switches to French or Japanese. :p

  All I need/want is a simple javascript function that will let me replace
the image with normal text to submit a form. I know this can be done
with 'submit()' but I haven't yet been able to figure out how to
actually implement it.

  I have a central 'tle-bu.js' file with all of my functions and different
forms have different names. So I need a way, I think, to tell the
function which form I am submitting. That's it. That's all I need. So
far most of what I have found on the web is built around form validation
which I don't need.

  Thanks as always!

Madison
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list