请教~HTML页面向PHP页面传递两个变量
1.html页面代码<SCRIPTLANGUAGE="JavaScript"><!--functioncheck_id_window(){vartextvalue=doc...
1.html页面代码
<SCRIPT LANGUAGE="JavaScript">
<!--
function check_id_window(){
var textvalue = document.myform.uname.value;
var radiovalue = window.location.href;
alert(textvalue);
alert(radiovalue);
}
//-->
</SCRIPT>
<FORM name="myform">
<input type="text" name="uname" value="123456">>
<input type="button" onClick="return check_id_window();" value="传递">
</FORM>
2.php页面代码
<input name="title" type="text" disabled="disabled" value="<?php echo $_GET['textvalue']?>"/>
<input name="title" type="text" disabled="disabled" value="<?php echo $_GET['radiovalue']?>"/>
请问,我怎么才能传过去?让那两个文本框显示出传递的变量?
<title>无标题文档</title>
<script language="javascript">
function send(){
var test1=document.getElementById("text").value;
var test2=document.location.href;
alert(test1);
alert(test2);
document.location.href='test2.php?test1='+test1+'&test2='+test2;
}
</script>
</head>
<body>
<input type="text" id="text" value="ssss" />
<input type="button" onclick="send();" />
</body>
php代码
<input type="text" disabled="disabled" value="<?php echo $_GET['test1']?>" />
<input type="text" disabled="disabled" value="<?php echo $_GET['test2']?>" />
已经解决~~~谢谢zxl_web 展开
<SCRIPT LANGUAGE="JavaScript">
<!--
function check_id_window(){
var textvalue = document.myform.uname.value;
var radiovalue = window.location.href;
alert(textvalue);
alert(radiovalue);
}
//-->
</SCRIPT>
<FORM name="myform">
<input type="text" name="uname" value="123456">>
<input type="button" onClick="return check_id_window();" value="传递">
</FORM>
2.php页面代码
<input name="title" type="text" disabled="disabled" value="<?php echo $_GET['textvalue']?>"/>
<input name="title" type="text" disabled="disabled" value="<?php echo $_GET['radiovalue']?>"/>
请问,我怎么才能传过去?让那两个文本框显示出传递的变量?
<title>无标题文档</title>
<script language="javascript">
function send(){
var test1=document.getElementById("text").value;
var test2=document.location.href;
alert(test1);
alert(test2);
document.location.href='test2.php?test1='+test1+'&test2='+test2;
}
</script>
</head>
<body>
<input type="text" id="text" value="ssss" />
<input type="button" onclick="send();" />
</body>
php代码
<input type="text" disabled="disabled" value="<?php echo $_GET['test1']?>" />
<input type="text" disabled="disabled" value="<?php echo $_GET['test2']?>" />
已经解决~~~谢谢zxl_web 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询