面向 iframe 的表单在 FireFox 中不起作用

Joe*_*wis 5 html php firefox

我有一个针对隐藏 iframe 的表单。这对于 IE 来说工作正常,但是当在 FireFox 中提交表单时没有任何反应。尚未提交。知道是什么造成了差异吗?

表单和 iframe 在这里:

<form name="dial" method="get" target="callout" action="/cgi-bin/make_call.php">    
    &nbsp;&nbsp;&nbsp;
    <input type="text" style="width:190px;" id="calling" name="calling" />
    <input type="hidden" name="caller" value="<? echo $extension; ?>">
    &nbsp;&nbsp;
    <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>
Run Code Online (Sandbox Code Playgroud)

正在加载的页面是:

<?
$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");  
?>
Run Code Online (Sandbox Code Playgroud)

如果我更改脚本以输出测试消息并定位可见的 iframe,我在 FireFox 中仍然什么也得不到,但它在 Internet Explorer 中再次完美运行。知道是什么造成了差异吗?

Ale*_*iol 4

您可能会遇到此处报告的问题:Firefox form targeting an iframe is opening new tab tl;dr: 请尝试向 iframe 添加“id”属性,其值与“name”属性相同,然后查看它是否可以解决您的问题问题。