473,626 Members | 3,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.

Feb 3 '06 #1
9 3988
"Poker Man" <po********@YAH OO.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
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
"Poker Man" <po********@YAH OO.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
On 2006-02-03, Poker Man <po********@YAH OO.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
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.s ubmit()}

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
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.s ubmit()}

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
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
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.c om/faq/> JL/RC: FAQ of news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Feb 5 '06 #9
Dr John Stockton <jr*@merlyn.dem on.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1916
by: M | last post by:
i am using submit buttons to send the user to different parts of a wizard. i am using if (if attribute.step1 exists) statements to send them to the appropriate section based on which submit button they pressed. well i would like to change these submit buttons into text links instead. however they do not pass form parameters like the submit button. any simple ways to accomplish this? this is what i have so far:
3
2597
by: Arun K | last post by:
Hi, I am creating a simple .aspx page to add some fields with validation. I have used different .NET validations like REquiredFieldValidator, RegularExpressionValidator and showed the summary in the bulleted list on top. I have 3 text boxes, and two RadioButtonList. and 3 buttons. One for Submit, Reset and Exit. If submit is pressed page should be validated and submit (insert into
6
4037
by: GD | last post by:
Hi, I wonder how to disable the "submit" behavior of a button. What I want is to assign values to dynamically added user controls without page postback. Problem: dynamically created control can not be accessed because the button click trigers page postback(see sample code). When the button is clicked, an error occurs: "System.NullReferenceException: Object reference not set to an instance of an object." Please help. Thanks.
5
2637
by: | last post by:
Hi all, Has anyone been able to write some custom javascript on the onclick event of submit button to do certain things like disable submit button, only submit form once etc. This was a breeze in 1.1 since I could edit the .js file. Now in 2.0 I can no longer do this. Also, my code would have to be called after all client-side validation was done and was successful. Any ideas? TIA!
1
2730
by: Bill_W_Stephens | last post by:
I have a complicated page with several submit buttons. I don't want to create multiple forms because much of the input is shared and the code is getting very ugly. However I would like to determine which values will be submited. Here is a simplified example that may better illustrate my question. Or maybe there is a better approach... <SCRIPT language="JavaScript">
0
1384
by: rn5a | last post by:
A custom control is derived from the WebControl class & encapsulates a TextBox & a Button. When the Button is clicked, the user is shown the JavaScript confirm dialog with the 'OK' & 'Cancel' buttons. If the user clicks 'OK', the TextBox gets populated with 'true' & if 'Cancel' is clicked, the TextBox gets populated with 'false'. Note that when the user first comes to the ASPX page that uses this custom control, the TextBox is empty. This...
10
8590
by: The Natural Philosopher | last post by:
I am coding up a bit of javascript stuff, and have managed to stumble my way through most of what I want.. But this one has got me stumped. I call submit() and get a javascript error 'Submit not defined' in Firefox.. My very expensive javascript Bible assures me its built in ..so where oh where have I FSCKED up?
3
10757
by: KOFI QUANSAH | last post by:
Hello, 1) I have a php script A with several buttons(not submit) on a form. 2) On click of any of the buttons, a specific javascript function is called. 3) Depending on the outcome of the javascript function, a second php script, (set in the action property of the form) B is called with the document.forms.submit() function. Problem: Javascript correctly references script B. However, I cannot reference any of the $_POST values....
0
8196
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8637
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7192
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6122
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5571
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2623
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1507
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.