|
@@ -1,41 +1,50 @@
|
|
|
<!DOCTYPE html>
|
|
|
-<html>
|
|
|
+<html lang="zh">
|
|
|
<head>
|
|
|
<meta charset="UTF-8">
|
|
|
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
- <title>Login and Registration</title>
|
|
|
-
|
|
|
+ <title>表单示例</title>
|
|
|
+ <style>
|
|
|
+ .form-box {
|
|
|
+ border: 1px solid #000;
|
|
|
+ border-radius: 10px;
|
|
|
+ padding: 20px;
|
|
|
+ width: 300px;
|
|
|
+ margin: 20px;
|
|
|
+ }
|
|
|
+ .form-item {
|
|
|
+ margin: 10px 0;
|
|
|
+ }
|
|
|
+ label {
|
|
|
+ display: inline-block;
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+ input[type="text"] {
|
|
|
+ border: 1px solid #ccc;
|
|
|
+ border-radius: 4px;
|
|
|
+ padding: 5px;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
</head>
|
|
|
<body>
|
|
|
-<!--https://aimp.aimpdev.k5.bigtree.tech/api/aimp-platform/out_api/processInvokeFile/jianbin_ocr-->
|
|
|
-<form method="post" action="https://aimp.btaimp.k7.bigtree.tech/api/aimp-platform/out_api/processInvokeFile/jianbin_ocr" enctype="multipart/form-data">
|
|
|
- <label for="file">选择文件:</label>
|
|
|
- <input type="file" id="file" name="file"><br><br>
|
|
|
-
|
|
|
- <label for="queryNo">自定义参数queryNo:</label>
|
|
|
- <input type="text" id="queryNo" name="queryNo"><br><br>
|
|
|
-
|
|
|
- <input type="submit" value="上传">
|
|
|
-</form>
|
|
|
-
|
|
|
-<script type="text/javascript">
|
|
|
- var form = document.querySelector('form');
|
|
|
- form.addEventListener('submit', function(event) {
|
|
|
- event.preventDefault(); // 阻止表单默认提交行为
|
|
|
-
|
|
|
- var fileInput = document.getElementById('file');
|
|
|
- var queryNoInput = document.getElementById('queryNo');
|
|
|
|
|
|
- var formData = new FormData();
|
|
|
- formData.append('file', fileInput.files[0]);
|
|
|
- formData.append('queryNo', queryNoInput.value);
|
|
|
+<div class="form-box">
|
|
|
+ <form action="/submit-form" method="post">
|
|
|
+ <div class="form-item">
|
|
|
+ <label for="name">用户名:</label>
|
|
|
+ <input type="text" id="name" name="name">
|
|
|
+ </div>
|
|
|
+ <div class="form-item">
|
|
|
+ <label for="password">密码:</label>
|
|
|
+ <input type="text" id="password" name="password">
|
|
|
+ </div>
|
|
|
+ <div class="form-item">
|
|
|
+ <label for="comment">性别:男</label>
|
|
|
+ </div>
|
|
|
+ <div class="form-item">
|
|
|
+ <input type="submit" value="提交表单">
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+</div>
|
|
|
|
|
|
- var xhr = new XMLHttpRequest();
|
|
|
- xhr.open('POST', form.action);
|
|
|
- xhr.setRequestHeader('appId', '85bbe16e29e240e89204f2951b894e84');
|
|
|
- xhr.setRequestHeader('secret', 'VAhNW2iELMafYRJrHIKxxk_y4LM0ewmg');
|
|
|
- xhr.send(formData);
|
|
|
- });
|
|
|
-</script>
|
|
|
</body>
|
|
|
-</html>
|
|
|
+</html>
|