First part’s easy enough:
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.3.min.js"> </script>
<script>
$(document).ready(function() {
$('#userInput').focus(function() {
$('#instructions').fadeOut();
});
});
</script>
<input id="userInput" type="textarea"></textarea>
<div id="instructions">Give me a text</div>
Doesn’t include color but that’s just CSS. If I understand the other part of your question, that takes a bit more coding but it’s still pretty basic. Try googling “jquery ajax callback” and you’ll see lots of examples.
Thread Starter
Neo
(@neocsatornaja)
This not realy working me:S
Here my printscreen
It’s very simple…i’ll give you some step just follow those & you will get what you want,
Step 1) : Create your HTML same as you screenshot. like,
<form>
<textarea name=”txt” class=”txt”></textarea><span class=”errtxt”>
</span>
<input type=”submit” name=”Submit” class=”submit”/>
</form>
Step 2) : Add you script (jquery/java script) on header within “<head>”.
& add this code as well just below the script…
<script>
$(document).ready(function(){
$(‘.submit’).click(function(){
vat txt = $(‘.txt’).val();
if(txt)
{
$(‘.errtxt’).css(‘color’,’#ff0000′);
$(‘.errtxt’).html(‘give me a text’);
return false;
}
});
$(‘.txt’).keypress(function(){
$(‘.errtxt’).css(‘color’,’#117004′);
$(‘.errtxt’).html(‘send successful’);
});
});
</script>
sorry, if error come. i didn’t test it. but surely this will work for you.
Thank you,