Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Html forms submit method is not working as expectation #1331

Open
2 tasks
TzHanChen1210 opened this issue May 27, 2023 · 1 comment
Open
2 tasks

Html forms submit method is not working as expectation #1331

TzHanChen1210 opened this issue May 27, 2023 · 1 comment

Comments

@TzHanChen1210
Copy link

TzHanChen1210 commented May 27, 2023

Bug Report

Problem

Html forms submit method is not working as expectation

What is expected to happen?

Should redirect the current page to the url which is setting at the action of attribute.

What does actually happen?

Nothing happening after trigger the submit method and no error appears in console.log

Information

Command or Code

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<form name="online" id="form" action="https://www.example.com" method="post" enctype="application/x-www-form-urlencoded" accept-charset="UTF-8">
<input type="text" name="RETURN_URL" value="example.com/callback">
<p class="edgeBox_Outer Adjust04"><input type="submit" id="submit" style="background: none; border: none; color: red; font-size: 90%;font-weight: bold; width:100%;" value ="Submit"> </p>

</form>
</body>
</html>

Environment, Platform, Device

Mac OS 13.3.1
iPhone 14 Pro - iOS 16.2 Simulator with Xcode 14.2

Version information

[email protected],
[email protected],
[email protected]
[email protected]
[email protected]
Xcode 14.2

Checklist

  • [x ] I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@breautek
Copy link
Contributor

An HTML form is probably not what you want to use in a Cordova application because:

  1. There is no "webserver" to locally post to to handle the post request, so it doesn't make much sense to post to a local URL.
  2. If you're posting to an external URL, then you're leaving your cordova application.

If you are posting to an external URL, that URL needs to be trusted in your allow list.

If you're integrating with an external server that uses forms, you can still use the JS Form API to submit the form without leaving the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants