Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

form field message?

Featured Replies

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

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>

  • 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

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

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>

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>

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.