目标iframe无法在FireFox中工作 [英] Form targeting iframe not working in FireFox
问题描述
我有一个针对隐藏的iframe的表单。这对IE来说工作正常,但在FireFox中提交表单时没有任何反应。未提交。任何想法是什么导致了区别?
表单和iframe在这里:
< form name =dialmethod =gettarget =calloutaction =/ cgi-bin / make_call.php>
& nbsp;& nbsp;& nbsp;
< input type =textstyle =width:190px; id =callingname =calling/>
< input type =hiddenname =callervalue =<?echo $ extension;?>>
& nbsp;& nbsp;
< input type =submitname =searchclass =btn btn-info btn-largestyle =width:65px; height:30px; position:relative; top:-5px; left: -2px; padding:0.2em;value =Dial/>
< / form>
< iframe name =calloutwidth =0height =0>< / iframe>
正在加载的页面是:
< ;?
$ caller = $ _GET ['caller'];
$ calling = $ _GET ['calling'];
//清除字符串中的非数字
$ calling = preg_replace(/ [^ 0-9] /,,$ calling);
//如果我们拨打一个7位数的号码,加一个9来访问一个外线
if(strlen($ calling)== 7){
$ calling = 9\" $调用。
//如果我们拨打10位数字加9和1来访问外线
if(strlen($ calling)== 10){
$ calling =91。$ calling;
//如果我们拨打11位数字,加9就可以访问外线
if(strlen($ calling)== 10){
$ calling =9。$ calling;
header(Location:http://XX.X.XX.XX:8070 / ShoreTelWebSDK / REST / DialNumber?callingExtension = $ caller& destinationNumber = $ calling);
?>
如果我更改脚本以输出测试消息并定位可见的iframe,我仍然没有在FireFox ,但它在Internet Explorer中仍然完美。任何想法是什么导致了这种差异?
解决方案针对iframe的Firefox表单打开新标签 tl; dr:尝试添加id 属性为iframe,与name属性具有相同的值,并查看它是否可以解决您的问题。
I have a form that targets a hidden iframe. This is working fine for IE, but nothing happens when the form is submitted in FireFox. The is not being submitted. Any idea what is causing the difference?
The form and iframe are here:
<form name="dial" method="get" target="callout" action="/cgi-bin/make_call.php">
<input type="text" style="width:190px;" id="calling" name="calling" />
<input type="hidden" name="caller" value="<? echo $extension; ?>">
<input type="submit" name="search" class="btn btn-info btn-large" style="width:65px; height: 30px; position:relative;top:-5px;left:-2px; padding:0.2em; " value="Dial" />
</form>
<iframe name="callout" width="0" height="0"></iframe>
The page being loaded is:
<?
$caller = $_GET['caller'];
$calling = $_GET['calling'];
//Clean the non numbers out of our string
$calling = preg_replace("/[^0-9]/","",$calling);
//If we are dialing a 7 digit number add a 9 to access an outside line
if(strlen($calling) == 7){
$calling = "9".$calling;
}
//If we are dialing a 10 digit number add 9 and 1 to access outside line
if(strlen($calling) == 10){
$calling = "91".$calling;
}
//If we are dialing a 11 digit number add 9 to access outside line
if(strlen($calling) == 10){
$calling = "9".$calling;
}
header("Location: http://XX.X.XX.XX:8070/ShoreTelWebSDK/REST/DialNumber?callingExtension=$caller&destinationNumber=$calling");
?>
If I change the script to output a test message and target a visible iframe i still get nothing in FireFox, but again it works perfect in Internet Explorer. Any idea what is causing the difference?
You may be facing the issue reported here: Firefox form targetting an iframe is opening new tab tl;dr: try adding an "id" attribute to the iframe, with the same value as the "name" attribute, and see if it resolves your problem.
这篇关于目标iframe无法在FireFox中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!