Ahh, that explains it. There isn't a submit button on the form. I have an
image that triggers the validation.
So... is there a way to get the form to submit without that. Perhaps I
should have a hidden submit button?
You don't *have* to have a submit button on the form, but you really
Dave,
$(#login)[0].submit();
Unfortunately that doesn't work either. In firebug I get:
$(#login)[0].submit is not a function
I get the same error with
document.login.submit();
The document.login.submit() would only work if you have a form tag w/the
name attribute of login.
What does
dave.methvin wrote:
Do you have a form with the id of login? If not, use a different
selector
to get it. The key is to call the submit method on the underlying DOM
object
of the form.
$(selector-to-your-form)[0].submit()
Yes it is there. Absolutely, definitely.
--
View this
malsup wrote:
You don't *have* to have a submit button on the form, but you really
should. What if javascript is disabled? You still want the form to
work, right?
You can use your image as a submit element if you like:
input type=image src=myImage.gif /
Actually my code starts
Mungbeans schrieb:
try this:
function submitLoginForm() {
//validation is working so I know that the load form function worked
// when this do, then is submitted
if ( ($(#username).val()== ) || ($(#passwd).val()== )) {
alert (Please complete the username and password fields.);
Olaf wrote:
function submitLoginForm() {
//validation is working so I know that the load form function worked
// when this do, then is submitted
if ( ($(#username).val()== ) || ($(#passwd).val()== )) {
alert (Please complete the username and password fields.);
Mungbeans schrieb:
Thanks, Olaf. Since last posting I reworked the javascript (pretty much as
you said):
Your image replace are shit. Looks so:
$(#submit-container).empty().append(input type=\image\
src=\images/signin.png\ AND SO ON /);
ATTENTION!!! - in Scripts are bad, see image name
Olaf wrote:
For what is this good? You have this in posted HTML!?
I'm not sure I understand this question or its tone. I posted into Nabble
in text. I have to remember to replace the lt: and gt; so it doesn't
print out as html. Pity Nabble doesn't have a quote or code button to wrap
Mungbeans schrieb:
Olaf wrote:
For what is this good? You have this in posted HTML!?
I'm not sure I understand this question or its tone. I posted into
Nabble in text. I have to remember to replace the lt: and gt; so
it doesn't print out as html. Pity Nabble doesn't have a quote or
Olaf wrote:
I ask why you replace in script a gif in a png and not use the
png in HTML!? ( !? == rhetorical ask == no answer necessarily ) ;)
I was playing around with the image formats seeing if they made to a
difference to the way they displayed. The images were exactly the same.
The
Form validation works properly but if the fields
are ok then the form isn't submitting.
You want to call the submit method of the form element. Your selector
doesn't look right, there is a space between form and #login. If the form
has an id of login, do this:
$(#login)[0].submit();
The
Try $(#login).submit(); or $(form#login).submit();
$(form #login) tries to find an element with an ID of login INSIDE a
form, rather than the form itself.
Karl Rudd
On 1/17/07, Mungbeans [EMAIL PROTECTED] wrote:
I'm posting this in the hope that the mere act will help me work out what it
is
dave.methvin wrote:
The jQuery submit() method calls any submit event handler on the form, but
doesn't submit the form. (Let the debate begin.)
Ahh, that explains it. There isn't a submit button on the form. I have an
image that triggers the validation.
So... is there a way to
dave.methvin wrote:
$(#login)[0].submit();
Unfortunately that doesn't work either. In firebug I get:
$(#login)[0].submit is not a function
I get the same error with
document.login.submit();
--
View this message in context:
14 matches
Mail list logo