You can implement this, 1. Create a Aura Attribute of type String set the default value what you want. 2. Create a Input Field and create value attribute in input tag. 3. Give the String attribute for value of the value tag attribute.
If you find your Solution then mark this as the best answer.
Suppose you have
<aura:attribute name="setdefaultval" type="String"/>
<lightning:input name="input8" value="{!v.ContactInstance.firstname}" dafault ="{!v.setdefaultval}" />
You can set default value in init handler.
doInit:function( cmp ,event,helper){
component.set("v.ContactInstance.firstname" ,"testing");
}
reference:
https://developer.salesforce.com/forums/?id=9060G0000005mEgQAI
If it helps Please mark it as best Answer.
Thanks!
All Answers
Suppose you have
<aura:attribute name="setdefaultval" type="String"/>
<lightning:input name="input8" value="{!v.ContactInstance.firstname}" dafault ="{!v.setdefaultval}" />
You can set default value in init handler.
doInit:function( cmp ,event,helper){
component.set("v.ContactInstance.firstname" ,"testing");
}
reference:
https://developer.salesforce.com/forums/?id=9060G0000005mEgQAI
If it helps Please mark it as best Answer.
Thanks!
Try Below Code Please Mark It As Best Answer If It HelpsThank You!
Greetings!
You can implement this,
1. Create a Aura Attribute of type String set the default value what you want.
2. Create a Input Field and create value attribute in input tag.
3. Give the String attribute for value of the value tag attribute.
If you find your Solution then mark this as the best answer.
Thank you!
Regards,
Suraj Tripathi