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

请问:在一个文本框中的数值,怎么传到另一个页面上,不用POST
<input   type= "text "   name= "skeyword "     id=sa   >
                                     
<input   type= "button "   name= "bwtmn "   value= "搜索 "     id=sb   onClick= "javascript:window.location.href= 'messagesend.php ' ">

要把文本框的值通过下面的button传到messagesend.php中去,因为都在同一个form下,提交整个表单进入另一个文件中,所以不能用$_POST传,怎么办?

------解决方案--------------------
<input type= "text " name= "skeyword " id=sa >

<input type= "button " name= "bwtmn " value= "搜索 " id=sb onClick= "javascript:window.location.href=\ "messagesend.php?skeyword= '+document.getElementById( 'sa ').value+ '\ " ">
------解决方案--------------------
[个人意见,仅供参考]
<script language= "javascript ">
function ToOtherLocation(){
window.location.href = "messagesend.php?skeyword= "+document.getElementById( 'sa ').value;
}
</script>

<input type= "text " name= "skeyword " id=sa >

<input type= "button " name= "bwtmn " value= "搜索 " id=sb onClick= "ToOtherLocation() ">

------解决方案--------------------
form.action= 'messagesend.php ';
form.submit();