Custom Submit buttons using Javascript | | |
Hi,
I know how to do Sumbit buttons in Forms, and I know how to do custom
buttons in Javascript.
What I can't seem to find is how to do custom Submit buttons using
Javascript!
Anybody out there have any pagesthat might provide a clue?
Thanks. | | | | re: Custom Submit buttons using Javascript
"Poker Man" <pokerordie@YAHOO.COM> wrote:
[color=blue]
>Hi,
>
>I know how to do Sumbit buttons in Forms, and I know how to do custom
>buttons in Javascript.
>
>What I can't seem to find is how to do custom Submit buttons using
>Javascript!
>
>Anybody out there have any pagesthat might provide a clue?
>[/color]
CSS.
--
Ed Jay (remove M to respond by email) | | | | re: Custom Submit buttons using Javascript
Lee wrote:
[color=blue][color=green]
>>If you're submitting a form, you should use an input of type="submit".
>>If you want to customize that button, use CSS. I don't see any role
>>for Javascript.[/color][/color]
Well, with CSS I canload a backgrounf image, but thatimage doesn't move
or change along with the button whenit is pressed, so figured this is a
job for javascript...no? | | | | re: Custom Submit buttons using Javascript
"Poker Man" <pokerordie@YAHOO.COM> wrote:
[color=blue]
>Lee wrote:
>[color=green][color=darkred]
>>>If you're submitting a form, you should use an input of type="submit".
>>>If you want to customize that button, use CSS. I don't see any role
>>>for Javascript.[/color][/color]
>
>Well, with CSS I canload a backgrounf image, but thatimage doesn't move
>or change along with the button whenit is pressed, so figured this is a
>job for javascript...no?[/color]
I'm not sure of the connection between your background image and the
submit button. Whatever...here's what I do to style the button.
In my style sheet, I define the class 'button' as:
..button {
padding: 1px;
font:10pt arial,sans-serif;font-weight:normal;
background: #fbebbf;
border:1px solid red;
}
And the button code as:
<input type=submit value="Continue" class="button">
--
Ed Jay (remove M to respond by email) | | | | re: Custom Submit buttons using Javascript
On 2006-02-03, Poker Man <pokerordie@YAHOO.COM> wrote:[color=blue]
> Hi,
>
> I know how to do Sumbit buttons in Forms, and I know how to do custom
> buttons in Javascript.
>
> What I can't seem to find is how to do custom Submit buttons using
> Javascript!
>
> Anybody out there have any pagesthat might provide a clue?[/color]
a guess: submit buttons should be descendents of the form.
what have you tried?
Bye.
Jasen | | | | re: Custom Submit buttons using Javascript
Poker Man wrote:
[color=blue]
> Hi,
>
> I know how to do Sumbit buttons in Forms, and I know how to do custom
> buttons in Javascript.
>
> What I can't seem to find is how to do custom Submit buttons using
> Javascript!
>
> Anybody out there have any pagesthat might provide a clue?
>
> Thanks.
>[/color]
here is how I should do:
in the head:
function go() { document.form.submit()}
in the form:
no submit button but a simple link with onClick="go()";
Links accept more CSS properties than buttons.
Ignace de Witte http://www.reunionislandguns.com | | | | re: Custom Submit buttons using Javascript
Ignace de Witte wrote:
[color=blue]
> Poker Man wrote:[color=green]
>> I know how to do Sumbit buttons in Forms, and I know how to do custom
>> buttons in Javascript.
>>
>> What I can't seem to find is how to do custom Submit buttons using
>> Javascript!
>>
>> Anybody out there have any pagesthat might provide a clue?
>> [...][/color]
>
> here is how I should do:
>
> in the head:
> function go() { document.form.submit()}
>
> in the form:
> no submit button but a simple link with onClick="go()";[/color]
And the button does not work without client-side script support, and it
is likely that the form could not be submitted then at all (or would you
provide for a second submit button?). The reasonable and competent
approach is of course to use the `submit' event of the `form' element
through its `onsubmit' event handler and use a standard submit button.
As it was explained numerous times before here.
[color=blue]
> Links accept more CSS properties than buttons.[/color]
That would not be a link which would be its major flaw.
PointedEars | | | | re: Custom Submit buttons using Javascript
Ed Jay wrote ...
[color=blue][color=green]
>>I'm not sure of the connection between your background image and the
>>submit button. Whatever...here's what I do to style the button.[/color][/color]
[color=blue][color=green]
>>In my style sheet, I define the class 'button' as:[/color][/color]
[color=blue][color=green]
>>.button {
>>padding: 1px;
>>font:10pt arial,sans-serif;font-weight:normal;
>>background: #fbebbf;
>>border:1px solid red;[/color][/color]
Correct. Except what you have here is a "modified" submit button.
Different colors, etc.
Perhaps it is the way I asked it, but my goal here is to make my own
button, with my own graphics. One graphics for the button normal,
another for it with focus, and another for it when it is pressed. The
most CSS offers is to give the button a background image, which doesn't
even move when the button is pressed.
That's why I think what I need is a Javascript way to do forms. | | | | re: Custom Submit buttons using Javascript
JRS: In article <gv0au1pll3oc8831d0ec149po8ijqdc05k@4ax.com>, dated
Sat, 4 Feb 2006 11:46:36 remote, seen in news:comp.lang.javascript, Ed
Jay <edMbj@aes-intl.com> posted :
[color=blue]
>In my style sheet, I define the class 'button' as:
>
>.button {
>padding: 1px;
>font:10pt arial,sans-serif;font-weight:normal;
>background: #fbebbf;
>border:1px solid red;
>}[/color]
Setting an absolute font size in pages intended for general access is
incompatible with Disability Access legislation in civilised countries.
Additionally, it handicaps those with normal sight but high-resolution
screens.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links. | | | | re: Custom Submit buttons using Javascript
Dr John Stockton <jrs@merlyn.demon.co.uk> wrote:
[color=blue]
>JRS: In article <gv0au1pll3oc8831d0ec149po8ijqdc05k@4ax.com>, dated
>Sat, 4 Feb 2006 11:46:36 remote, seen in news:comp.lang.javascript, Ed
>Jay <edMbj@aes-intl.com> posted :
>[color=green]
>>In my style sheet, I define the class 'button' as:
>>
>>.button {
>>padding: 1px;
>>font:10pt arial,sans-serif;font-weight:normal;
>>background: #fbebbf;
>>border:1px solid red;
>>}[/color]
>
>Setting an absolute font size in pages intended for general access is
>incompatible with Disability Access legislation in civilised countries.
>
>Additionally, it handicaps those with normal sight but high-resolution
>screens.
>[/color]
I agree 100%. That said, the above was extracted from a site that is not
publicly accessible, but used only by subscription from a small audience
(medical docs).
--
Ed Jay (remove M to respond by email) |  | Similar JavaScript / Ajax / DHTML bytes | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,414 network members.
|