Skip to main content

jquery newsletter submit - loading message



i have a newsletter form i use on my site using ajax with jquery. i want to show to a user a wait message. what is the best option?





heres what i have so far:







<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>

<script type="text/javascript">

$(document).ready(function() {

$('#submit').click(function(e) {

$.ajax({

type: "POST",

url: '/save.php',

data: $('#form').serialize(),

cache: false,

success: function(result) {

// my code when success

}

});

});

});



</script>



<div id="newsletter">

<form id="form">

<label for="email">Your Email*:</label>

<input name="email" value="" type="text" id="email" size="30" maxlength="255" />

<span id="submit">Submit</span>

</form>

</div>







thanks



Source: Tips4all

Comments

Popular posts from this blog

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?