Solved! RE:Simple probably; javascript for form submission

linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org
Tue May 24 17:36:28 UTC 2005


Gah! My bad... it's working now.

My problem was that I had copied the original image submit line and
created a new line to play with the javascript. I didn't realize until
just now that in the commented line was an '<input type="hiddem" name="x"
value="y">' that I needed. Put that back and voila! Both yours and Lances
suggestions work.

  Thanks to both of you!!

Madison

> 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