【发布时间】:2015-02-01 02:48:26
【问题描述】:
我有一个简单的 html 表单,我在其中输入标题和描述并点击提交。页面顶部是一些我经常复制并粘贴到这些字段中的文本段落。这是一个重复的工作,段落是用php动态生成的。
我可以在每个段落或 div 的末尾放置一个按钮或链接,以使用脚本填充我的表单输入字段吗?然后我要做的就是点击提交。我已经在页面上使用 jquery 了。
编辑:
<p>Sentence one. Longer than this</p><!--would like a button here to populate field in form below-->
<p>Sentence two. Longer than this</p>
<p>Sentence three. Longer than this</p>
<form id="sampleform" action="actionpage.php" method="post">
Title<input type="text" name="title>
Desc<input type="text" name="title>
<input type="submit" value="Submit"></form>
【问题讨论】:
-
你能给我们一些代码来看看吗?
-
它有我不想分享的信息,但我会准备一个样本。
-
添加了基本设置。
标签: javascript html forms