Simple probably; javascript for form submission

Jim Skehill JimS-pFJmkVL1u50 at public.gmane.org
Tue May 24 19:20:15 UTC 2005


Nothing complicated. Just define UserName and Password as input tags. The
HTML I have is:
			...
                <tr> 
                  <td width="33%" height="29"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">Login ID</font></td>
                  <td width="67%"><input type="text" name="UserName"
onKeyPress="return checkEnter(event, document.login)"/></td>
                </tr>
                <tr> 
                  <td width="33%" height="32"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">Password</font></td>
                  <td width="67%"><input type="password" name="Password"
onKeyPress="return checkEnter(event, document.login)"/></td>
                </tr>
			...


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


Thanks!

  I am having the same problem that I am having with Lance's example
though. When I try to submit the form by clicking on the text the
pagereloads properly but no data was sent. In this case I am also trying
to perform a login so I need to send the username and password which
doesn't seem to be happening. Do I need to do something special to pass
the values from the form?

Thanks!!

Madison

> /*
>  * Function called to submit the page
>  */
> function doSubmit(fname) {
> 	fname.submit();
> }
>
> -----Original Message-----
> From: linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org [mailto:linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org]
> Sent: May 24, 2005 1:23 PM
> To: tlug-lxSQFCZeNF4 at public.gmane.org
> Subject: RE: [TLUG]: Simple probably; javascript for form submission
>
>
>> 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.
>
>   Thanks for the reply, Jim!
>
>   What is the 'doSubmit' routine? I just get an 'Error: doSubmit is not
> defined' error in Mozilla when I tried to run it with just the html
> (though I wasn't surprised). :p
>
>   Thanks!
>
> 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
>

--
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