HTML没有提交提交按钮或JavaScript [英] html submit without submit button or JavaScript

查看:335
本文介绍了HTML没有提交提交按钮或JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我有一个简单的表格上有一个加号和减号,并在中间值。我试图创建下加和负下A HREF链接调用自身,而是既表明使用了哪个环节(正或负的),或者被递增或递减之后传递的价值。

Currently I have a simple form with a plus and minus on it and a value in the middle. I am trying to create a href link under the plus and under the minus to call self but to either indicate which link was used (either plus or minus) or to pass the value after being incremented or decremented.

我不想使用JavaScript /客户端脚本,因为有些浏览器不允许,但我使用PHP。我也不想使用$ _GET其他数据需要,所以我使用$ _ POST发送到'自我'。

I do not want to use JavaScript/client side scripting because some browsers do not allow it but I am using PHP. I also did not want to use $_GET as other data needs to be sent to 'self' so I am using $_POST.

任何想法的欢迎。

code的片段

var_dump($_POST);
< form action="?" method="post" action="Submit" >
< input type="hidden" id="currentvalue" name="currentvalue" value="2" / >

< div class="minus" >< a href="" onclick="document.forms[0].submit();return false;" > - < /a > < /div >
< div class="currentvalue">'.$_POST["currentvalue"].'< /div >
< div class="plus"> + < /div >

感谢

推荐答案

您不能没有使用按钮输入类型提交一个HTML表单=图像/提交元素或JS。

You cannot submit an HTML form without using the button or input type=image/submit elements or JS.

你可以做什么:


  1. 指定为输入类型=图像的图像

  2. 申请一个BG图像输入类型=提交并通过杀文本TEXT-INDENT:-999em; 现代浏览器和行高的IE

  3. 分割区域到单独的形式,如果你真的有

  1. Specify an image for input type=image
  2. Apply a bg image to input type=submit and killing the text via text-indent:-999em; for modern browsers and line-height for IE
  3. Split areas into separate forms if you really have to

这篇关于HTML没有提交提交按钮或JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆