日期:2014-05-17  浏览次数:20860 次

href的问题
<a   href= "javascript:window.location.href= 'fproduct.asp?name= '+document.getElementByid( 'textarea1 ').innerHTML "
> <img     src= "../image/xiazai_8.jpg "   width= "50 "   height= "16 "   border= "0 "     /> </a>
---------------
大家帮我看看这句ASP的代码有什么错误,我的目的很简单,就是实现搜索,比如,我的一个文本框,我点一个按妞,把这个文本框的值获取,然后到数据库里实现搜索

------解决方案--------------------
<a href= "location.href( 'fproduct.asp?name= '+document.getElementByid( 'textarea1 ').value) "
> <img src= "../image/xiazai_8.jpg " width= "50 " height= "16 " border= "0 "> </a>

试试这样

------解决方案--------------------
<input name= "textarea1 " /> <a href= "javascript:location.href= '1.asp?name= '+textarea1.value "
> <img src= "../image/xiazai_8.jpg " width= "50 " height= "16 " border= "0 "> </a>
------解决方案--------------------
<img onclick= "location.href( 'fproduct.asp?name= '+document.getElementByid( 'textarea1 ').value) " src= "../image/xiazai_8.jpg " width= "50 " height= "16 " border= "0 "> </a>
------解决方案--------------------
<img onclick= "javascript:window.location.href= 'fproduct.asp?name= '+document.getElementByid( 'textarea1 ').innerHTML " src= "../image/xiazai_8.jpg " width= "50 " height= "16 " border= "0 "> </a>
------解决方案--------------------
上面的 </a> 忘记去掉了
------解决方案--------------------
<input name= "textarea1 " /> <a href= "javascript:location.href= 'fproduct.asp?name= '+textarea1.value "
> <img src= "../image/xiazai_8.jpg " width= "50 " height= "16 " border= "0 "> </a>

我本地测试可以读到值
------解决方案--------------------
textarea1是否在存
------解决方案--------------------
注意,文本框里要加上

id= "textarea1 "

只有name= "textarea1 "
是不行的.
------解决方案--------------------
唉,为了100分........
------解决方案--------------------
<input name= "textarea1 " /> <a href= "javascript:location.href= 'fproduct.asp?name= '+textarea1.value "
> <img src= "../image/xiazai_8.jpg " width= "50 " height= "16 " border= "0 "> </a>
<%response.write request( "name ")%>


把这个单独保存为fproduct.asp
看看就知道是否可以读出值了