0

standard html or lightning input has a attribute "placehodler" that allows us to enter a place holder value for the input field, but lightning:inputField does not have that attribute supported. Is there a work around to achieve this or am i missing something here ? <lightning:inputField name="Phone" placeholder = "enter phone number" />

1

I found a workaround solution for this. We need to make the lightning:InputField disabled and then use lightning-input for the place holder. Then on submit of the form in javascript controller set the field value before submitting.

0

According to the documentation, the same attribute is available for lightning-input.

<lightning-input type="email"
                 label="Email"
                 pattern=".+@example.com"
                 placeholder="username@example.com">
</lightning-input>
4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.