Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Textbox control read only not able to edit in react JS SPFX webpart

$
0
0

I want to update the value in textbox control in reactJS SPFX webpart.

But when i am trying to modify its in readonly mode.

How can we edit the textbox control.

My code:

=======================================================

import*asReact from'react';
importstylesfrom'./Edt.module.scss';
import { IEdtProps }from'./IEdtProps';
import { escape }from'@microsoft/sp-lodash-subset';
exportinterfaceIEdtState{
"descriptionName":""
}
exportdefaultclassEdt extendsReact.Component<IEdtProps,IEdtState> {
publicconstructor(props:IEdtProps, state:IEdtState){
super(props);
varself =this;
this.state = {
descriptionName:""
};
}
publicOnchangeBuilding(event:any): void {
this.setState({descriptionName:event.target.value });
//alert(this.state.descriptionName);
}
publicrender():JSX.Element {
return (
<div>
<inputtype="text"value= "Raj"onChange={this.OnchangeBuilding.bind(this)}/>
</div>
);
}
}

====================================================

UI:

====================================

======================================

I am not able to modify the text in above control


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>