用get方式提交如何取到某个元素的值,渠道的那个值是根据复选框的是否选中来取得!
function checkboxA(){
var checkbox1 = document.getElementById("checkbox1");
if(checkbox1.checked){
document.getElementById("state").value = "1";
}else{
document.getElementById("state").value = "0";
}
}
<input type = "checkbox" value = "0" onclick = "checkboxA()" id = "checkbox1" />
<input type = "hidden" name = "state" id = "state" value = "0"/>get方式提交
<a href="Product_productList?page=1&state=隐藏表单元素的值" onclick = "checkboxA()" id="href1">首页</a>红色的部分是怎么取到值的,
请大家给解决一下!
function checkboxA(){
var checkbox1 = document.getElementById("checkbox1");
if(checkbox1.checked){
document.getElementById("state").value = "1";
}else{
document.getElementById("state").value = "0";
}
}
<input type = "checkbox" value = "0" onclick = "checkboxA()" id = "checkbox1" />
<input type = "hidden" name = "state" id = "state" value = "0"/>get方式提交
<a href="Product_productList?page=1&state=隐藏表单元素的值" onclick = "checkboxA()" id="href1">首页</a>红色的部分是怎么取到值的,
请大家给解决一下!
解决方案 »
- 关于javamail的一个问题
- struts中用迭代器获取不到值
- 读取数据库数组越界错误。。帮忙看看。。
- 关于递归
- 有点难度哦~~!读取任意JavaBean的属性及属性值,强者速来
- jdk一个奇怪的问题?大家有没遇到过。
- 怎样用html分析器来提取htm页面里的正文内容?
- 没有任何问题的xml,dom4j抛出这样的异常,奇怪!!
- 有谁可以提供给我一份关于xerces的xml解析器的所有函数帮助文档,为什么我在它的网站xml.apache.org没有找到它的1.4.1的文档。还有关于sax2.0的文档也没找到。谢谢!
- 求大神指点一个上传文件(Excel文件)到数据库保存的问题
- java FTP 上传问题。 求解。
- httpclient 登陆163问题
System.out.println(cs); %>
取出来的值为空!
取不到的!
<a href="javascript:;" onclick="location ='Product_productList?page=1&state='+state.value;">首页</a>
直接写在href是没作用的,因为在加载页面的时候就初始化了。你必须通过js来弄。方法很多。我就写了上面的。希望对你有帮助。
我用Javascript搞定了!
function checkboxA(){
var checkbox1 = document.getElementById("checkbox1");
if(firstPage.href.indexOf("&state") > 0){
firstPage.href = firstPage.href.substring(0,firstPage.href.length-8);
}
if(checkbox1.checked){
document.getElementById("state").value = "1";
firstPage.href=firstPage.href+"&state=1";
}else{
document.getElementById("state").value = "0";
firstPage.href=firstPage.href+"&state=0";
}
}
删除的记录 <input type = "checkbox" value = "0" onclick = "checkboxA()" id = "checkbox1" />
<input type = "hidden" name = "state" id = "state" value = "0"/><a href="Product_productList?page=1&state=0" onclick = "checkboxA()" id = "firstPage" >首页</a>
谢谢大家的参与