HTML没有提交提交按钮或JavaScript [英] html submit without submit button or 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.
你可以做什么:
- 指定为
输入类型=图像的图像
- 申请一个BG图像
输入类型=提交
并通过杀文本TEXT-INDENT:-999em;
现代浏览器和行高
的IE - 分割区域到单独的形式,如果你真的有
- Specify an image for
input type=image
- Apply a bg image to
input type=submit
and killing the text viatext-indent:-999em;
for modern browsers andline-height
for IE - Split areas into separate forms if you really have to
这篇关于HTML没有提交提交按钮或JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!