Simple probably; javascript for form submission...Ammended

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


> linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org wrote:
> So, What you really want is some css'ed text to call a Javascript
finction to act like a submit button...
>
> Javascript:
>
> function Submit_My_From()
> {
> document.froms.My_Form.submit()
> }
>
> HTML:
>
> <form name="My_Form" action="/cgi-bin/somewhere" method="Post">
> <a href="#" style="text-decoration: none"
> onClick="Submit_My_From()">Button</a>
> </form>
>
> Enjoy
>
> Lance
>
> Forgot the 'onClick'

  Hi,

  The form *seems* to submit (the page reloads) but the values in the form
(in this case the username and password) are not passed. Do I need to do
something special to make the form submit /and/ pass the values?

  The form is structured like this at the moment (typing it from another
computer so forgive typos):

...
<script language="javascript" src="/tle-bu.js"></script>
...
<form action="/cgi-bin/tle-bu.cgi" method="post" name="login">
User Name: <input type="text" size="10" name="Name"><br>
Password: <input type="password" size="10" name="Pass"><br>
<a href="#" onClick="doSubmit()">Login</a><br>
</form>

  The actual funtion in the 'tle-bu.js' file is:

function doSubmit ()
{
    document.forms.login.submit();
}

  Is anything overly obvious missing?

  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





More information about the Legacy mailing list