Php HTML表单:从输入字段转到url
我有一张Php HTML表单:从输入字段转到url,php,html,forms,refresh,Php,Html,Forms,Refresh,我有一张表格: <form method="post" action="/whatIwroteintotheInputfield"> <input type="text" onchange="this.form.submit();"></input> </form> 表单在插入值后正在过帐。现在,我不仅想刷新站点,还想重定向到输入字段中的/whatiwrote。 我怎样才能做到这一点 谢谢你的阅读 <form method="po
表格
:
<form method="post" action="/whatIwroteintotheInputfield">
<input type="text" onchange="this.form.submit();"></input>
</form>
表单在插入值后正在过帐。现在,我不仅想刷新站点,还想重定向到输入字段中的/whatiwrote。
我怎样才能做到这一点
谢谢你的阅读
<form method="post" action="yourTextURL">
<input type="text" id="changeText" value="http://"></input>
</form>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script>
$("#changeText").on('change', function() {
var url = $('#changeText').val();
window.location = url;
});
</script>
$(“#changeText”)。在('change',function()上{
var url=$('#changeText').val();
window.location=url;
});
有关更多信息,请查看&
还有,我这边的一个问题。那么你为什么需要
。也可以在不使用
的情况下完成。因此,如果可能(如果不需要),请删除
$(“#changeText”)。在('change',function()上{
var url=$('#changeText').val();
window.location=url;
});
有关更多信息,请查看&
还有,我这边的一个问题。那么你为什么需要
。也可以在不使用
的情况下完成。因此,如果可能(如果不需要),请删除
谢谢你,伙计!我已经在使用jquery,所以这似乎是最好的解决方案。谢谢你的回答!:)很高兴能帮助:D:)
@skalibran谢谢你!我已经在使用jquery,所以这似乎是最好的解决方案。谢谢你的回答!:)很高兴能帮你:D:)
@Skalibran