I have an issue but I can not figure out what the "name" to attach to a CSS action.
I have an eMail kind of form, with just three inputs:
a "textarea" for comments
input type="text" for the visitors' name
input type="email" for the vistors' eMail address
They are all bound by the class "form-control".
What I want to do is:
- Have the first input (textarea) to automatically be in focus rather than require a visitor to select one of the inputs.
- Once a visitor has entered a response to each of the inputs, I would like to change the background-color, and perhaps seal the input against modifications..
That's it! How do I make these changes to the css file?
Hi Paul, what you're after
Hi Paul, what you're after can't really be done just by CSS I don't think.
Autofocus is what you need for your first query https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus
For your second query, how are you going to define when the user is finished and "lock" the field? You can apply the readonly attribute https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly but what happens if the user accidentally tabs out of a field, or makes a mistake? What is the reason for stopping them amending the fields before submitting the form?