Using jQuery, how can I add a default value of http:// into an input field that can’t be removed, but that still allows you to type a URL after it?
Defa
That's not possible. You can put a value in the input field, but it can be deleted.
You can put the text outside the input field, that will protect it from being deleted, but it won't be included in the value when the form is posted.
You can use absolute positioning to put the input field on top of the text, and use padding in the field so that you start typing after the text. Example:
CSS:
.UrlInput { position: relative; }
.UrlInput label { position: absolute; left: 3px; top: 3px; color: #999; }
.UrlInput input { position: absolute; left: 0; top: 0; padding-left:40px; }
HTML: