这是我正在尝试的代码
<script>
var output = "<table id='e' border><tr><td><input type='text' id=/"t"/></td><td><input type='text' id=/"t1/"></td><td><input type='text1' id=/"t2"/></td><td><input type='text1' id=/"t3"/></td><button onclick=del('"+ divId +"')>delete</button></td></tr></table>";
</script>
<body>
<form method=post action="t.php">
<input type="text" id= ??(from script...)
</body>
为了将脚本中的参数发送到文本字段中一一形成,我要做什么 shell?有没有可能?
最佳答案
在 PHP 中:
<?php
if($_POST['submit'])
{
$user = $_POST['user'];
$pass = $_POST['pass'];
//Here you have the text in php variables. You can do whatever you want with them
}
?>
<form method="post" enctype="multipart/form-data" name="form">
Username: <input type="text" name="user" required>
Password: <input type="password" name="pass" required>
</form>
关于javascript - 如何将多个参数从javascript转换为html表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21168957/