制作一个表单来传递参数
Make a form to pass parameters
我有一个表单,但它不会将参数"url"answers"USERNAME"传递到下一页。有什么问题吗?
对于样式问题,我必须使用<button>
而不是<input>
。
这是表格:
<form action="/confirmation/index.php" method="post" class="form-wrap">
<div class="loader-wrap">
<div class="loader-txt">
</div>
</div>
<div class="field-set url-field">
<input type="text" name="url" data-placeholder="Your Website URL" maxlength="50" class="validate">.
<button name="url_btn" type="button" class="btn url-btn">Scan My Site!</button>
</div>
<div class="field-set email-field">
<input type="text" name="USERNAME" data-placeholder="Your E-mail" maxlength="50" class="validate">
<button name="email_btn" type="button" class="btn email-btn" style="width:174px;font-size:15px;">Send me Results!</button>
</div>
</form>
email_btn的类型应该是="submit",而不是="button",因此:
<button type="submit">Send me the results</button>
请参阅此处:
http://www.w3schools.com/tags/tag_button.asp
这应该与提交按钮一起使用!
(额外的php是为了证明它的工作原理!)
<?php
if (isset($_POST['submitted'])) {
echo "form submitted";
}
?>
<form action="index.php" method="post" class="form-wrap">
<div class="loader-wrap">
<div class="loader-txt">
</div>
</div>
<div class="field-set url-field">
<input type="text" name="url" data-placeholder="Your Website URL" maxlength="50" class="validate">.
<button name="url_btn" type="button" class="btn url-btn">Scan My Site!</button>
</div>
<div class="field-set email-field">
<input type="text" name="USERNAME" data-placeholder="Your E-mail" maxlength="50" class="validate">
<button name="email_btn" type="button" class="btn email-btn" style="width:174px;font-size:15px;">Send me Results!</button>
<button name="submitted" type="submit">Send me the results</button> //Submit Button
</div>
</form>
相关文章:
- 使用html表单中的参数调用JavaScript函数
- HTML页面如何提取通过表单传递的参数
- 如何在submit to sightly时将表单输入值作为参数传递给WCMUsePojo
- 在带有参数列表的表单submit上调用一个方法
- 如何使用angularjs服务将表单参数传递给Rest
- 如何使用JQueryUI滑块控制web音频API振荡器参数,而无需经过HTML表单参数
- 使用提交按钮参数自动提交表单
- 提交前筛选表单参数
- 在 Sails.js 中重新排序文件上传的表单参数
- reCAPTCHA 自定义表单参数名称
- JQuery 不传递 SELECT 表单参数
- 在 Rails 中发送带有link_to的表单参数
- 如何使用RestEasy REST.Request访问表单参数
- 如何获取表单参数后发送的post请求与jQuery post
- FormData()不能从HTML中提取表单参数
- 将Prototype Ajax调用转换为jQuery(添加表单参数和加载函数)
- 使用操作向web服务发送表单参数
- JQuery提交表单参数为空
- AngularJS - 表单参数不是通过使用 PHP 中的角度路由提交表单来传递的
- 使用javascript使用HTML表单参数重定向URL