September 15, 201214 yr Hi, Please could someone tell me how to leave a message within a form field? I've got a PHP contact form and would like to leave the message within the area they type their message. Thank you Neil
September 15, 201214 yr Do you have a link to it? I am not sure what you mean <textarea rows="5" cols="10">Is This What You Mean ?</textarea>
September 15, 201214 yr Author Yeah sure. The client would like it to say: Let me know what you need doing? Give as much or as little detail as you want. I'll be back in touch very shortly. So she would like this text to appear in the box under where it says 'message'. Then this text should disappear once someone starts typing their message. http://www.emmaheathmakeup.co.uk/contactemma.html
September 15, 201214 yr does this link help you if not i will do it for you in jquery http://thewebthought.blogspot.com/2011/10/javascript-delete-default-text-when.html
September 15, 201214 yr ok jquery working example http://www.html5imageeditor.co.uk/wdf/textarea/ and the jquery <!doctype html> <html> <head> <meta charset="UTF-8"> <title>Untitled Document</title> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function() { $("#message").focus(function() { $("#message").empty(); }) }); </script> <textarea rows="10" cols="45" id="message">Let me know what you need doing? Give as much or as little detail as you want. I'll be back in touch very shortly.</textarea> </div> </body> </html>
September 15, 201214 yr You should be using 'Placeholder' for this sort of stuff. It won't work on older browsers, but everybody should be developing with a modern approach imo. <textarea placeholder="Let me know what you need doing? Give as much or as little detail as you want. I'll be back in touch very shortly."></textarea>
September 16, 201214 yr You should be using 'Placeholder' for this sort of stuff. It won't work on older browsers, but everybody should be developing with a modern approach imo. <textarea placeholder="Let me know what you need doing? Give as much or as little detail as you want. I'll be back in touch very shortly."></textarea> yes but but like you say it does not work in older browsers so you need a fallback anyway? http://uniquemethod.com/html5-placeholder-text-jquery-fallback-with-modernizr
Create an account or sign in to comment