我有一个以隐藏的iframe为目标的表单。这适用于IE,但在FireFox中提交表单时没有任何反应。没有提交。知道是什么导致了这种差异吗?
表单和iframe在这里:
<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>
正在加载的页面是:
<?
$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");
?>
如果我更改脚本以输出测试消息并定位可见的iframe,我仍然无法在FireFox中获得任何内容,但它再次在Internet Explorer中完美运行。知道是什么导致了这种差异吗?
答案 0 :(得分:3)
您可能会遇到此处报告的问题:Firefox form targetting an iframe is opening new tab tl; dr:尝试向iframe添加“id”属性,其值与“name”属性相同,看看它是否可以解决您的问题
答案 1 :(得分:0)
尝试将“@”添加到iframe名称/目标。
<iframe name="@callout"></iframe>
<form target="@callout"></form>
帮助标识符识别名称。名称需要具体而独特。