promise06
promise06

Reputation: 83

how to submit a html form by webview in react-native

I got a web page by fetch in react-native. The web page is like :

<html><body onload="document.forms[0].submit();"><form action='XXX' method="post"><input type="hidden" name="keywords" value='hello' /></form></html>

. Then how can I post this web page in react-native?

Upvotes: 2

Views: 3655

Answers (1)

promise06
promise06

Reputation: 83

It is resolved by WebView. Like this:

<WebView source={{html:'<html><body onload="document.forms[0].submit();"><form action='XXX' method="post"><input type="hidden" name="keywords" value='hello' /></form></html>
'}}></WebView>.

Upvotes: 4

Related Questions