输入类型图像提交表单值? [英] Input Type image submit form value?

查看:71
本文介绍了输入类型图像提交表单值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用此代码尝试通过表单提交值,但似乎没有提交任何内容......



我通常会使用复选框或



这个代码错了吗?

 < input id =test1name =test1type =imagesrc =images / f.jpgvalue =myValuealt =/> 

所以我想传递value =myValue中的值。



表单工作正常,所以这不是问题,我只需要帮助输入部分不提交,因为我知道这是有效的。



感谢

解决方案

输入类型=图片仅将图片定义为提交按钮,而不是一个可以将值传递给服务器的输入。

I am using this code to try and submit a value via form but it doesn't seem to submit anything...

I would normally use a checkbox or Radio buttons for multiple options but I want to use an image to do this.

Is this code wrong?

<input id="test1" name="test1" type="image" src="images/f.jpg" value="myValue" alt="" />

So I want to pass the value in value="myValue".

The form works fine so that's not the problem, I just need help with the input part not submitting as I know that works.

Thanks

解决方案

An input type="image" only defines that image as the submit button and not as an input that can carry over a value to the server.

这篇关于输入类型图像提交表单值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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