You need to sign in to do that
Don't have an account?

How to set default value to lightning:input in lightning
Hi All ,
is it possible to set default value on lightning:input ?
below code : dafault attribute not supporting
<aura:attribute name="setdefaultval" type="String"/>
<lightning:input name="input8" value="{!v.ContactInstance.firstname}" dafault ="{!v.setdefaultval}" />
is it possible to set default value on lightning:input ?
below code : dafault attribute not supporting
<aura:attribute name="setdefaultval" type="String"/>
<lightning:input name="input8" value="{!v.ContactInstance.firstname}" dafault ="{!v.setdefaultval}" />
The default is only text ( default ="0" or default = "toto" )
https://developer.salesforce.com/docs/component-library/bundle/lightning:input/documentation
Otherwise, you use the init event for dynamic values.
Invoking Actions on Component Initialization: Use the init event to initialize a component or fire an event after component construction but before rendering.
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_cb_init_handler.htm
below code working for me
doInit:function( cmp ,event,helper){
component.set("v.ContactInstance.firstname" ,"testing");
}