1

I need to pause for maybe 500 miliseconds before I submit a form. Here is what I have so far:

 $(".rowqty input").bind("keyup", function() { $("#ViewCartPage form").animate({ opacity: 1.0 }, 3000).submit() });

so when someone changes the quantity of the input field it submits the form, but I want it to wait for a slight amount of time incase they need a moment to type 2 or 3 numbers.

As you can see I tried the animate function to try and delay things but with no luck.

I know I could use this: http://blog.mythin.net/projects/jquery.php

I'd rather not add another JS to my site if there is a way around it.

EDIT: Actually the pause plugin above is not working for me either.

asked Nov 5, 2008 at 13:48

2 Answers 2

3

Give this a shot:

$(".rowqty input").bind("keyup", function() { setTimeout("$('#ViewCartPage form').submit()", 500 });
answered Nov 5, 2008 at 13:51
Sign up to request clarification or add additional context in comments.

3 Comments

worked like a charm - funny how I don't even think about regular JS anymore - DOH!
Better to use a function than a string:$(".rowqty input").bind("keyup", function() { setTimeout( function() { $('#ViewCartPage form').submit() }, 500 });
with 1.4 there is also the delay function that can be used. api.jquery.com/delay
0
setTimeout(function () {$("#formID").submit()},1000);

it works for me (no quotes)

answered May 5, 2012 at 9:17

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.