Click here to get back home

Submit a form without using a button?

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Submit a form without using a button? gb 12-24-2004
Get Chitika Premium
Posted by gb on December 24, 2004, 4:26 pm
Please log in for more thread options
Within a form, the usual way of submitting it is to use e.g.

<INPUT TYPE="submit" VALUE="Send ">

This produces the standard button. Is there an easy way to portray this as
though it were a simple hypertext link?

Second question: Is there any way to customize a submit button other than
the text that it displays? i.e. can I change the colour and/or size?

Thanks to anyone who can help

--
news@REMO*VEbusipages.com




Posted by Neal on December 24, 2004, 12:25 pm
Please log in for more thread options

> Within a form, the usual way of submitting it is to use e.g.
>
> <INPUT TYPE="submit" VALUE="Send ">
>
> This produces the standard button. Is there an easy way to portray this
> as
> though it were a simple hypertext link?

Doing so would be confusing to the user. AFAIK, that isn't possible.

> Second question: Is there any way to customize a submit button other than
> the text that it displays? i.e. can I change the colour and/or size?

See http://www.w3.org/TR/html401/interact/forms.html#edef-INPUT for what
can be done in the HTML, and you can apply some CSS as well.

IIRC not all browsers allow the color to change. But there is the src
attribute to use an image as the button.



Posted by Harlan Messinger on December 24, 2004, 5:15 pm
Please log in for more thread options

>Within a form, the usual way of submitting it is to use e.g.
>
><INPUT TYPE="submit" VALUE="Send ">
>
>This produces the standard button. Is there an easy way to portray this as
>though it were a simple hypertext link?
>
>Second question: Is there any way to customize a submit button other than
>the text that it displays? i.e. can I change the colour and/or size?
>

You need CSS. However, the effectiveness of CSS for any form control
is browser-dependent (perhaps because browsers typically borrow
existing controls from the operating system and have only just so much
leeway to change them). If I use the following styles:

border: none;
background-color: transparent;
text-decoration: underline;
color: blue;

IE displays an underlined blue label without border or background;
Mozilla and Firefox do the same except without the underline; and
Opera shows a button with no background and a blue label without the
underline.

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ๔ter le premier point de mon adresse de courriel.


Posted by haido on December 25, 2004, 12:35 pm
Please log in for more thread options
Yes it can be done with the help of javascript

Using anchor tag:
example
<form name=test action=ccccc>
......
......
</form>

<a onmousedown="ssub()" style="cursor: pointer;">jjjjj</a>

Here we call a javascript function on mouse press. The style is
required to make a mouse pointer, as we won't use href tag.

in the javascript function we will submit the form
<script language=javascript>
function submitss()
{
documnet.test.submit();
}
</script>

using a image in button
http://www.hscripts.com/tutorials/html/form3.php
Hope this explains.

-
haido
http://www.hscripts.com



Posted by Harlan Messinger on December 27, 2004, 11:05 am
Please log in for more thread options

> Yes it can be done with the help of javascript
>
> Using anchor tag:
> example
> <form name=test action=ccccc>
> .....
> .....
> </form>
>
> <a onmousedown="ssub()" style="cursor: pointer;">jjjjj</a>
>
> Here we call a javascript function on mouse press. The style is
> required to make a mouse pointer, as we won't use href tag.
>
> in the javascript function we will submit the form
> <script language=javascript>
> function submitss()
> {
> documnet.test.submit();
> }
> </script>
>
> using a image in button
> http://www.hscripts.com/tutorials/html/form3.php
> Hope this explains.

Which can be useful but is best avoided if your site otherwise doesn't
require Javascript to function, because this will *make* it
Javascript-dependent.



Similar ThreadsPosted
How to get rid of focus on submit button of a form. September 5, 2004, 1:21 pm
Using multiple button type="submit" elements within a form April 15, 2005, 4:24 pm
Newbie: How to use graphic instead of submit button on HTML form? August 29, 2006, 5:57 am
Multiple form submit buttons - setting a default button March 19, 2008, 4:03 am
CSS submit button problem March 17, 2005, 1:08 pm
No submit button in xforms August 4, 2006, 6:14 pm
Submit button and click vs. enter July 30, 2004, 5:33 pm
Problems with using an image in a submit button August 27, 2004, 8:43 am
submit button image -- can u do rollover?? September 15, 2004, 12:53 pm
CSS and Submit Button problem (across browsers) February 6, 2006, 2:20 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap