I want to make an input with some read-only text and some writable text. It should always say “www.” at the beginning (read only) and afterwards the user should be able to write whatever he wants. What is the easiest way to do this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The “easiest” way would be to have a separate element underneath (or surrounding) the
input.http://jsfiddle.net/NxWBT/
However, this’ll be for presentational purposes only. If you need the
wwwpart submitted, you’ll have to add it with Javascript before the form is submitted.