隐藏的输入值不会通过表单传递到新的URL [英] Hidden Input Values not being passed through form to New URL

查看:134
本文介绍了隐藏的输入值不会通过表单传递到新的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小的HTML文件在网站框架中工作。它目前请求一个邮政编码,然后调用一个php页面来查询数据库。 iframe从父页面获取id号码,然后从它自己的页面获取邮政编码。这是代码片段。

 < script> 
pid = window.location.search;
pid = pid.substring(11,16)
htmlout ='< input type =hiddenname =productidid =productidvalue ='+ pid +'> ;
< / script>
< body style =margin:0px; background-color:#ECECEC;>

< form action =https://www.net10wirelessphones.com/Mini-zip-Lookup.htmlstyle =text-align:leftmethod =get>
< script>
document.write(htmlout);
< / script>< span style =font-size:9pt>< span style =font-family:Arial,Helvetica,sans-serif; color:#444444>验证范围在你的地区。输入您的邮递区号:
< / span>& nbsp;
< / span>
< input name =zipsize =5type =text/>
< input type =submitvalue =GO/>& nbsp;< / form>

然而,当我输入邮编00631时,它只能到站点
< a href =http://www.net10wirelessphones.com/Mini-zip-Lookup.html?zip=00631 =nofollow> http://www.net10wirelessphones.com/Mini-zip-Lookup.html? zip = 00631



这似乎是从表格中切断隐藏的价值。关于我可能做错的任何建议?

编辑:对于那些想要尝试的人,请使用邮编00631和产品ID 17637进行尝试。它应该接受此选项并直接进入zipsuccess页面。

编辑:另外,如果您想从头看到它,请转到 https://www.net10wirelessphones.com/zipstart.html?productid=17637 。对不起,我忘了将它包含在那些已经尝试过的人。

解决方案

我得到了程序工作。事实证明,问题是以另一种形式发送到此页面。我必须稍微改变一个名称属性。



这:

 < input name =idid =productidtype =hiddenvalue =/> 

更改为:

 < input name =productidtype =hiddenid =productidvalue =/> 

并且它工作正常。谢谢你们的帮助!


I have a small html file working in the frame of a website. It currently requests a zip code and then calls a php page to query the database. The iframe gets the id number from the parent page and then gets the zip code from its own page. Here is the code snippet.

<script>
pid = window.location.search;
pid = pid.substring(11,16)
htmlout = '<input type = "hidden" name = "productid" id = "productid" value = "' + pid + '">';
</script>
<body style="margin: 0px; background-color: #ECECEC;">

<form action="https://www.net10wirelessphones.com/Mini-zip-Lookup.html" style="text-align: left" method = "get">
<script>
document.write(htmlout);
</script><span style="font-size: 9pt"><span style="font-family: Arial, Helvetica, sans-serif; color: #444444">Verify coverage in your area. Enter your Zip Code: 
</span>&nbsp;     
</span>
<input name="zip" size="5" type="text" />
<input type="submit" value="GO" />&nbsp;</form>

However, When I enter the zip code 00631, it only goes to the site http://www.net10wirelessphones.com/Mini-zip-Lookup.html?zip=00631

It seems to be cutting off the hidden value from the form. Any suggestions on what I may be doing wrong?

Edit: For those of you wanting to try it out, try it with the zip code 00631 and the product id 17637. It should accept this option and direct to the zipsuccess page.

Edit: Also, if you want to see it from the start go to the page https://www.net10wirelessphones.com/zipstart.html?productid=17637. Sorry I forgot to include it for those who have been trying it out.

解决方案

I got the program to work. It turns out the problem was in another form that sent to this page. I had to make a slight change to a name attribute..

This:

<input name="id" id="productid" type="hidden" value="" />

Changed to:

 <input name="productid" type="hidden" id="productid" value="" />

And it worked fine. Thanks guys for your help!

这篇关于隐藏的输入值不会通过表单传递到新的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆