0

I am working on integrating paytm payment service in reactjs , I am having a request from html file in nodejs I want to submit the form from react, like in react native we have an option like "WebView" so that by using the build in property "injectedJavaScript" we are able to submit the form by using the form name in nodejs.

Example (in react native):

<WebView 
  source={{uri: ""}}
  injectedJavaScript={`document.form-name.submit()`}
/>

As we see in the above code, that can be done in react native using WebView, so I want to know do I have anything like the same in react js ? Hope you got my question

6
  • You're asking if you can submit a form in React? Commented Oct 29, 2019 at 12:51
  • sorry , your question not clear enough, you want to know code to submit form or what ? anyway if you are building scalable app , you can use redux-form.com/8.2.2 Commented Oct 29, 2019 at 12:55
  • 1
    How is this question related in any way to redux-form? Commented Oct 29, 2019 at 13:04
  • i am following youtube.com/watch?v=9sR_iB9wPfg link , so in that video he will be submiting a form written in the server which is in nodejs from react by using a method "WebView" in React native , what i want is to perform the same stuff in reactjs, please If this is not clear watch that video if possible Commented Oct 29, 2019 at 13:42
  • @JeraldGeorge are you asking how to submit a form in Node.js on the server-side, without it being sent to a web browser? Or are you asking how to get your React code to a web browser from Node.js ? Commented Oct 29, 2019 at 19:01

2 Answers 2

1

In React Native, the user is on a device, interacting with the WebView, which is an embedded browser within an app. The user is interacting through a web page, although they might not realise it.

In React, the user is in a web browser. The React equivalent of WebView is the user's browser (like Chrome, Firefox, etc). You must serve them the HTML and javascript containing your React code.

In React Native, the user opens your app. In React, the user types in your website URL (like jeraldgeorge.example.com) in their browser. In React Native, this will open your app, containing your WebView. In React, this will connect to a server you run, which must serve the same HTML that is in the WebView.

Sign up to request clarification or add additional context in comments.

Comments

0

you can use redux-form from redux and pass a redux action when the form is submitted that handles a post request to the backend(nodejs) using axios . https://redux-form.com/6.6.1/docs/gettingstarted.md/

3 Comments

How is this question related in any way to redux-form? And why would you link to a version from like three years ago?
i think redux form is a really efficient way to do what he's asking about and that's what i been using and the link was an example of how to use it .
Sure, redux-form is pretty nice, I use it too--but it's not at all related to the question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.