apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 987 forks source link

Html forms submit method is not working as expectation #1331

Open TzHanChen1210 opened 1 year ago

TzHanChen1210 commented 1 year ago

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>

Page Title

Environment, Platform, Device

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

Version information

vue@3.2.38, vite@3.1.9, cordova@12.0.0 cordova-lib@12.0.1 cordova-ios@6.3.0 Xcode 14.2

Checklist

breautek commented 7 months ago

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.