【问题标题】:html how to send data via post by clicking a stringhtml 如何通过单击字符串通过帖子发送数据
【发布时间】:2016-01-06 10:15:35
【问题描述】:

一种通过点击以下字符串通过帖子发送数据的方法

<form action="the page I want to send to.php" method="post">
<input type="hidden" name="data" value="the data I want to send">
<input type="submit" value="the string I want to show">
</form>

但是,它看起来像一个按钮。 我不想那样。我希望字符串看起来像普通字符串,但它可以通过单击字符串通过 post 发送数据。

你知道怎么做吗?

【问题讨论】:

标签: html


【解决方案1】:

也许通过删除提交按钮的所有样式:

input[type=submit] {
  background: none;
  border: none;
  pointer: default;
  display: inline;
  margin: 0;
  padding: 0;
}
<form action="the page I want to send to.php" method="post">
<input type="hidden" name="data" value="the data I want to send">
In this text is <input type="submit" value="the string I want to show">
</form>

这使您的提交按钮看起来像普通文本。

【讨论】:

  • 虽然这几乎是我想要的东西,但“我要显示的字符串”无法执行内联。有什么办法可以调整吗?
  • 是的,它是 CSS。我只是对其进行了编辑以使其内联。是这个意思吗?
  • 它是否适用于所有提交输入?我怎样才能只应用到这个提交输入?
  • 它只会应用于提交按钮,因为input[type=submit]
  • 在表单中添加id="form_name",并将其更改为#form_name input[type=submit]
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-08-17
  • 2020-11-08
  • 1970-01-01
  • 1970-01-01
  • 2020-08-16
  • 2010-11-22
  • 1970-01-01
相关资源
最近更新 更多