By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,426 Members | 2,928 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,426 IT Pros & Developers. It's quick & easy.

Custom Submit buttons using Javascript

P: n/a
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.

Feb 3 '06 #1
Share this Question
Share on Google+
9 Replies


P: n/a
"Poker Man" <po********@YAHOO.COM> wrote:
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?

CSS.

--
Ed Jay (remove M to respond by email)
Feb 3 '06 #2

P: n/a
Lee wrote:
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.


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?

Feb 4 '06 #3

P: n/a
"Poker Man" <po********@YAHOO.COM> wrote:
Lee wrote:
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.


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?


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)
Feb 4 '06 #4

P: n/a
On 2006-02-03, Poker Man <po********@YAHOO.COM> wrote:
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?


a guess: submit buttons should be descendents of the form.

what have you tried?
Bye.
Jasen
Feb 5 '06 #5

P: n/a
Poker Man wrote:
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.


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
Feb 5 '06 #6

P: n/a
Ignace de Witte wrote:
Poker Man wrote:
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?
[...]
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()";


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.
Links accept more CSS properties than buttons.


That would not be a link which would be its major flaw.
PointedEars
Feb 5 '06 #7

P: n/a
Ed Jay wrote ...
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;


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.

Feb 5 '06 #8

P: n/a
JRS: In article <gv********************************@4ax.com>, dated
Sat, 4 Feb 2006 11:46:36 remote, seen in news:comp.lang.javascript, Ed
Jay <ed***@aes-intl.com> posted :
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;
}


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.
Feb 5 '06 #9

P: n/a
Dr John Stockton <jr*@merlyn.demon.co.uk> wrote:
JRS: In article <gv********************************@4ax.com>, dated
Sat, 4 Feb 2006 11:46:36 remote, seen in news:comp.lang.javascript, Ed
Jay <ed***@aes-intl.com> posted :
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;
}


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.

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)
Feb 5 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.