I have a textbox to save the user facebook's url.
<tr>
<td>
Facebook:
</td>
<td>
<input style="width:300px" type="text" name="facebook" value="http://www.facebook.com/$facebook">
</td>
</tr>
How can i make the value "http://www.facebook.com/" fixed and uneditable?
UPDATE:
the $facebook
part needs to be editable!!
There are two methods to do this. One is to add the attribute
disabled="disabled"
to it, or addreadonly
to it.Both work differently. What you need might be
disabled="disabled"
attribute.EDIT
fiddle updated. You should include following jQuery code:
You may use keyboard events too, I am myself a beginner in jQuery, hence this basic piece of code. :) Also, update the
input
tag to this:try it like this
You may try this.
I think you are asking to have "http://www.facebook.com/" uneditable, but be able to edit the remainder of the url?
Something like the below snippet would be the simplest approach. Some tweaking of the styles as in the CSS below would make it more presentable.
You can use javascript to force the prefix to remain entered at all cost.
I don't know if this is what your looking for but it is the best I could do.
Here's the JSFiddle:
http://jsfiddle.net/FaxE4/104/