show submit button after delay with jquery mobile

I'm trying to delay the appearance of the submit button....
here is my code:

<!DOCTYPE html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>

<body>

<div data-role="page">
	<div data-role="content">
		<fieldset>
			<form>
		
				<input type="submit" data-theme="b" value="continue" id="submitButton" name="continue">
			
			</form>
		</fieldset>
	</div>
</div>

<script>
$(document).ready(function(){
    function hidesubmit(){
	  $("#submitButton").hide();
	}
	function showsubmit(){
	  $("#submitButton").show();
	}
});
setTimeout(hidesubmit, 0);
setTimeout(showsubmit, 2000);
</script>


</body>
</html>

Open in new window

arielbfAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Robert SchuttSoftware EngineerCommented:
Either put the setTimeout calls inside the document.ready()  function or put the function definitions outside it. In this case, looking at the placement of the code, I think you can just use:
<script>
    function hidesubmit(){
	  $("#submitButton").hide();
	}
	function showsubmit(){
	  $("#submitButton").show();
	}
setTimeout(hidesubmit, 0);
setTimeout(showsubmit, 2000);
</script>

Open in new window

0
arielbfAuthor Commented:
I've try it and it is still not working...
0
Robert SchuttSoftware EngineerCommented:
Can you be a bit more specific? I've put it in a jsFiddle and it works without a problem so maybe there is something else influencing your code or html page?

see: http://jsfiddle.net/robert_schutt/7wefn6wg/
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

arielbfAuthor Commented:
I've checked the jsFiddle and it is working. For some reason it is not working when I test my page. Here it is...
delay1.html
0
Robert SchuttSoftware EngineerCommented:
There is a <div> surrounding that button doing the styling. You could use the following code but it's kind of a 'hack' I'm afraid...
<script>
  function hidesubmit(){
	  $("#submitButton").closest("div").hide();
	}
	function showsubmit(){
	  $("#submitButton").closest("div").show();
	}
setTimeout(hidesubmit, 0);
setTimeout(showsubmit, 10000);
</script>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
arielbfAuthor Commented:
It is working now (-:
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.