wittenra Posted February 6, 2017 Share Posted February 6, 2017 Hi there, I have a form with a field, which will be prefilled, but this field is a text box and editable for everyone. But i want it only as a readonly field, but this field can´t be changed directly to a html field, so i was wondering, is it possible to copy the body of that field and show it as readonly and only, if it is not empty? I do not want to use a button for that Thanks a lot in advance Link to comment Share on other sites More sharing options...
WoHe Posted February 6, 2017 Share Posted February 6, 2017 Could you tell me more specific what you want to do? As I see it, you've got in input field with type=text and you want to copy the text from this input field into another element. I should do this with javascript: var text = document.getElementById("[id of the input field]").value; document.getElementById("[id of the other element]").innerHTML = text; 1 Link to comment Share on other sites More sharing options...
wittenra Posted February 6, 2017 Author Share Posted February 6, 2017 thx, that´s it already! you helped a lot! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now