I am currently rendering the HTML content in Webview. That HTML content hosted in cloud and loading in Webview using the html link. Here, I need to add the below checkbox tags in that content while dynamically rendering or I need to show the checkbox on bottom of the page.
<div>
<input type="checkbox" id="agreement_id" name="agreement" value="agreement">
<label for="other">I have read and accept the Electronic Communications Agreement consenting to the use of Electronic Records in connection with opening my new deposit credit accounts requested through the Swell mobile app.</label>
</div>
Is any possible to add programmatically in react native Webview?
I have figured out the answer here: Used injectedJavaScript.
const scripts1 = document.write(
'<div> <input type="checkbox" id="agreement_id" name="agreement" value="agreement"> <label for="other">content</label> </div>',
);
const webviewContent = () => {
return (
<View
style={{
height: windowHeight - heightBottom * 1.5,
marginLeft: 10,
marginRight: 10,
}}>
<WebView
style={{backgroundColor: colors.primaryBackgroundColor}}
originWhitelist={['*']}
source={{
uri: 'https://www.google.com',
}}
injectedJavaScript={scripts1}
/>
</View>
);
};