473,401 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

submit() not defined? WTF?

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?

Its all within a form..that all works but I haven't yet defined a submit
button, because ultimately I want a clickable image with dreadful
graphics emblazoned on it..or something.

Heres the snippet..

if (confirm(message))
submit();
Aug 29 '07 #1
10 8563
On Aug 30, 6:38 am, The Natural Philosopher <a...@b.cwrote:
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?

Its all within a form..that all works but I haven't yet defined a submit
button, because ultimately I want a clickable image with dreadful
graphics emblazoned on it..or something.

Heres the snippet..

if (confirm(message))
submit();
That infers that you are trying to call submit as a method of the
window object, but it belongs to the HTMLFormElement interface, so:

form.submit();

may work a little better. :-)

In any case, fire the confirm from the form's submit method, don't
rely on script to submit the form itself:

<form onsubmit="return confirm(...)" ... >
--
Rob

Aug 29 '07 #2
RobG wrote:
On Aug 30, 6:38 am, The Natural Philosopher <a...@b.cwrote:
>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?

Its all within a form..that all works but I haven't yet defined a submit
button, because ultimately I want a clickable image with dreadful
graphics emblazoned on it..or something.

Heres the snippet..

if (confirm(message))
submit();

That infers that you are trying to call submit as a method of the
window object, but it belongs to the HTMLFormElement interface, so:

form.submit();

may work a little better. :-)

In any case, fire the confirm from the form's submit method, don't
rely on script to submit the form itself:

<form onsubmit="return confirm(...)" ... >

That would work if the form HAD a submit..it doesn't

Its got a nice cell in a table exactly sized for a transparent edged
button image as background image, and some clickable text overlaid..only
way I could use a generic button with overlaid text on it.

i.e.
<TD align="center" width="180px" height="55px"
background="../Images/Button1.gif"><b class="s3"
onclick="submit_form()">Update Rate</b></td>

Looks really sexy. Can you chain two onclick events somehow so that the
text changes color when its clicked?

--
Rob
Aug 29 '07 #3
RobG said the following on 8/29/2007 4:57 PM:
On Aug 30, 6:38 am, The Natural Philosopher <a...@b.cwrote:
>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?

Its all within a form..that all works but I haven't yet defined a submit
button, because ultimately I want a clickable image with dreadful
graphics emblazoned on it..or something.

Heres the snippet..

if (confirm(message))
submit();

That infers that you are trying to call submit as a method of the
window object, but it belongs to the HTMLFormElement interface, so:

form.submit();

may work a little better. :-)
I don't think I agree with you 100% that "submit()" "belongs to..." as
you can define your own submit() function and then still submit a form.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Aug 29 '07 #4
The Natural Philosopher said the following on 8/29/2007 5:11 PM:

<snip>
Can you chain two onclick events somehow so that the
text changes color when its clicked?
Did you try it?

onclick="changeTheColor();submitTheForm()"

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Aug 29 '07 #5
Randy Webb wrote:
The Natural Philosopher said the following on 8/29/2007 5:11 PM:

<snip>
>Can you chain two onclick events somehow so that the text changes
color when its clicked?

Did you try it?

onclick="changeTheColor();submitTheForm()"
No, I was waiting for someone to suggest it ;-)

It makes a twisted sense..

would onclick="{do_this();do_that();dotheother();}" also work?

Thanks...thats exactly what I wanted. What a pleasure to have
knowledgeable people instead of arrogant prats in this group.
Aug 29 '07 #6
The Natural Philosopher said the following on 8/29/2007 6:43 PM:
Randy Webb wrote:
>The Natural Philosopher said the following on 8/29/2007 5:11 PM:

<snip>
>>Can you chain two onclick events somehow so that the text changes
color when its clicked?

Did you try it?

onclick="changeTheColor();submitTheForm()"
No, I was waiting for someone to suggest it ;-)

It makes a twisted sense..

would onclick="{do_this();do_that();dotheother();}" also work?
Are you waiting on me to suggest that you test it? <gIt won't as it is
a syntax error to have the { and } there. Without them, it works fine.
Thanks...thats exactly what I wanted. What a pleasure to have
knowledgeable people instead of arrogant prats in this group.
Dang, and just when I had been practicing being an arrogant prat in this
group. All that studying and practice wasted... Can you send me a blonde?

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Aug 29 '07 #7
Randy Webb said the following on 8/29/2007 7:20 PM:
The Natural Philosopher said the following on 8/29/2007 6:43 PM:
>Randy Webb wrote:
>>The Natural Philosopher said the following on 8/29/2007 5:11 PM:

<snip>

Can you chain two onclick events somehow so that the text changes
color when its clicked?

Did you try it?

onclick="changeTheColor();submitTheForm()"
No, I was waiting for someone to suggest it ;-)

It makes a twisted sense..

would onclick="{do_this();do_that();dotheother();}" also work?

Are you waiting on me to suggest that you test it? <gIt won't as it is
a syntax error to have the { and } there. Without them, it works fine.
I hate it when I do that......
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Aug 29 '07 #8
On Aug 30, 7:11 am, The Natural Philosopher <a...@b.cwrote:
RobG wrote:
On Aug 30, 6:38 am, The Natural Philosopher <a...@b.cwrote:
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?
Its all within a form..that all works but I haven't yet defined a submit
button, because ultimately I want a clickable image with dreadful
graphics emblazoned on it..or something.
Heres the snippet..
if (confirm(message))
submit();
That infers that you are trying to call submit as a method of the
window object, but it belongs to the HTMLFormElement interface, so:
form.submit();
may work a little better. :-)
In any case, fire the confirm from the form's submit method, don't
rely on script to submit the form itself:
<form onsubmit="return confirm(...)" ... >

That would work if the form HAD a submit..it doesn't
It doesn't rely on a submit button, it relies on the form's submit
handler being called.

Its got a nice cell in a table exactly sized for a transparent edged
button image as background image, and some clickable text overlaid..only
way I could use a generic button with overlaid text on it.

i.e.
<TD align="center" width="180px" height="55px"
background="../Images/Button1.gif"><b class="s3"
onclick="submit_form()">Update Rate</b></td>
Consider an input type=image, then you have a real submit button that
doesn't rely on script to submit the form.
--
Rob

Aug 30 '07 #9
RobG wrote:
On Aug 30, 7:11 am, The Natural Philosopher <a...@b.cwrote:
>RobG wrote:
>>On Aug 30, 6:38 am, The Natural Philosopher <a...@b.cwrote:
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?
Its all within a form..that all works but I haven't yet defined a submit
button, because ultimately I want a clickable image with dreadful
graphics emblazoned on it..or something.
Heres the snippet..
if (confirm(message))
submit();
That infers that you are trying to call submit as a method of the
window object, but it belongs to the HTMLFormElement interface, so:
form.submit();
may work a little better. :-)
In any case, fire the confirm from the form's submit method, don't
rely on script to submit the form itself:
<form onsubmit="return confirm(...)" ... >
That would work if the form HAD a submit..it doesn't

It doesn't rely on a submit button, it relies on the form's submit
handler being called.

>Its got a nice cell in a table exactly sized for a transparent edged
button image as background image, and some clickable text overlaid..only
way I could use a generic button with overlaid text on it.

i.e.
<TD align="center" width="180px" height="55px"
background="../Images/Button1.gif"><b class="s3"
onclick="submit_form()">Update Rate</b></td>

Consider an input type=image, then you have a real submit button that
doesn't rely on script to submit the form.
I haven't found a way to generate arbitrary button text via php onto a
imaged button. There is no command I know of to have an image behind
text apart from using a background image in e.g. a table cell. Feel free
to enlighten me if it ain't so. Hmm. will onclick work with a table
CELL? That might be better than working with the text, actually..

This may of of faint interest to others..the theory is to use a database
to organize the screens for the data base forms. A bit recursive, but
then you can e.g.set up buttons to invoke forms and the form to do this
is in fact a form in itself. Using the button image as background means
I can write over the top with clickable text.

I can generate the text on the fly, from the database, but not allow the
users to type in what they wanted to have on the buttons, if it was a
clickable foreground image.

The idea is to produce within a fairly large database application a way
to have user configurable 'hot button' bars ...

Anyway thanks to all the first form is now complete. Apart from the
<SELECTflyout stuff looking like the browser wants it to look, nearly
everything else looks like how I want it to look.

Elegant simple and intuitive: At least I hope so.
>
--
Rob
Aug 30 '07 #10
On Aug 30, 2:29 am, The Natural Philosopher <a...@b.cwrote:
RobG wrote:
On Aug 30, 7:11 am, The Natural Philosopher <a...@b.cwrote:
RobG wrote:
On Aug 30, 6:38 am, The Natural Philosopher <a...@b.cwrote:
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?
Its all within a form..that all works but I haven't yet defined a submit
button, because ultimately I want a clickable image with dreadful
graphics emblazoned on it..or something.
Heres the snippet..
if (confirm(message))
submit();
That infers that you are trying to call submit as a method of the
window object, but it belongs to the HTMLFormElement interface, so:
form.submit();
may work a little better. :-)
In any case, fire the confirm from the form's submit method, don't
rely on script to submit the form itself:
<form onsubmit="return confirm(...)" ... >
That would work if the form HAD a submit..it doesn't
It doesn't rely on a submit button, it relies on the form's submit
handler being called.
Its got a nice cell in a table exactly sized for a transparent edged
button image as background image, and some clickable text overlaid..only
way I could use a generic button with overlaid text on it.
i.e.
<TD align="center" width="180px" height="55px"
background="../Images/Button1.gif"><b class="s3"
onclick="submit_form()">Update Rate</b></td>
Consider an input type=image, then you have a real submit button that
doesn't rely on script to submit the form.

I haven't found a way to generate arbitrary button text via php onto a
imaged button. There is no command I know of to have an image behind
text apart from using a background image in e.g. a table cell. Feel free
to enlighten me if it ain't so. Hmm. will onclick work with a table
CELL? That might be better than working with the text, actually..

Use a "button" tag together with a CSS background image. The "button"
tag can also contain inline HTML tags.

-David

Aug 30 '07 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Terence Parker | last post by:
How does one go about submitting a form with a link - but submitting it to a new window AND to a page different to that described within the action="" option of the <form> tag? Say, for example,...
6
by: JSjones | last post by:
Hi all, I'm new to these boards and my javascript experience is fairly limited and basic so please bear with me. Anyway, on to the question and some background. I'm developing using ColdFusion...
4
by: J Krugman | last post by:
The following line document.someForm.next = new Submit("next"); produces the error Error: Submit is not defined I find this surprising, given that Submit descends from Object, and the...
29
by: Mic | last post by:
Goal: delay execution of form submit Code (Javascript + JScript ASP): <% Response.Write("<OBJECT ID='IntraLaunch' STYLE='display : none' WIDTH=0 HEIGHT=0...
8
by: horos | last post by:
hey all, Ok, a related question to my previous one on data dumpers for postscript. In the process of putting a form together, I'm using a lot of placeholder variables that I really don't care...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
2
by: Gayathri | last post by:
Please find the pasted html, <html> <script language="JavaScript" src="cal.js"></script><!-- Date only with year scrolling --> </head> <BODY onLoad="showDetails()"> <script...
1
by: gbezas | last post by:
Hi All, I have added an event handler to redirect form.submit() to a newSubmit() method that I have defined (which does some additional processing before submitting the form). Additionally I...
14
by: white lightning | last post by:
How to have <select onchange="this.form.submit()"and also a Submit button on one form? I have something like this: <form action="<?php $_SERVER; ?>" method="post"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.