2

我使用以下 HTML 代码通过 Email-Me 表单构建了一个联系表单:

     <link rel="stylesheet" type="text/css" href="contact_us.css" />
<link rel="stylesheet" type="text/css" href="http://www.emailmeform.com/builder/theme_css/VaHUixmgcX0Qd0BO1a4ho" />
<script type="text/javascript">
if (typeof jQuery == 'undefined'){
    document.write(unescape("%3Cscript src='http://www.emailmeform.com/builder/js/jquery-1.7.1.min.js' type='text/javascript'%3E%3C/script%3E"));
}
</script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
<script type="text/javascript">
if (typeof $.ui == 'undefined'){
    document.write(unescape("%3Cscript src='http://www.emailmeform.com/builder/js/jquery-ui-1.7.2.custom.min.js' type='text/javascript'%3E%3C/script%3E"));
}
</script>
<script type="text/javascript" src=http://www.emailmeform.com/builder/js/dynamic.php?t=post&t2=0&use_CDN=true"></script>
    <script type="text/javascript" src="contact_us.js"></script>
<div id="emf-container-outer" >
  <div id="emf-container"style="background-color: #FBF8EF">
    <div id="emf-logo">
      <a>EmailMeForm</a>
    </div>
 <form target="_top" id="emf-form" class="centerLabel" enctype="multipart/form-data" method="post" action="http://www.emailmeform.com/builder/form/VaHUixmgcX0Qd0BO1a4ho" name="emf-form">
<form id="emf-form" class="centerLabel" enctype="multipart/form-data" method="post" action="http://www.emailmeform.com/builder/form/VaHUixmgcX0Qd0BO1a4ho" name="emf-form" target="_top">

      <div id="emf-form-instruction" class="emf-head-widget" style="left:10px; width" >
        <div id="emf-form-title" class="emf-bold" align="right"style="left:10px; font-family:sans-serif ">
          צרו קשר
        </div>
        <div id="emf-form-description" align="right"style="left:10px; font-family: sans-serif; top:10px">


contacr

        </div>
      </div>
      <ul>
        <font size="2pt" face="arial">
        <li id="emf-li-0" class="emf-li-field emf-field-text data_container" style="text-align:right">
          <label class="emf-label-desc" for="element_0">name <span>*</span></label>
          <div class="emf-div-field">
            <input id="element_0" name="element_0" value="" size="22" type="text" class="validate[required]" style="z-index:" />
          </div>

          <div class="emf-clear"></div>
        </li>
        <li id="emf-li-1" class="emf-li-field emf-field-number data_container" style="text-align:right">
          <label class="emf-label-desc" for="element_1">phone number <span>*</span></label>
          <div class="emf-div-field">
            <input id="element_1" name="element_1" class="validate[required,length[9 ,10],custom[extNumber]]" value="" size="22" type="text" />
          </div>
         <div class="emf-clear"></div>
        </li>
        <li id="emf-li-2" class="emf-li-field emf-field-email data_container" style="text-align:right">
          <label class="emf-label-desc" for="element_2">Email <span>*</span></label>
          <div class="emf-div-field">
            <input id="element_2" name="element_2" class="validate[required,custom[email]]" value="" size="22" type="text" />
          </div>
          <div class="emf-clear"></div>
        </li>
        <li id="emf-li-3" class="emf-li-field emf-field-textarea data_container" style="text-align:right">
          <label class="emf-label-desc" for="element_3">title <font color="red">*</font>    </label>
          <div class="emf-div-field">
            <textarea id="element_3" name="element_3" cols="18" rows="5" class="validate[required]">
</textarea>
          </div>
          <div class="emf-clear"></div>
        </li>
        <li id="emf-li-post-button" class="middle">
          <input value="שלח טופס" type="submit" onmouseover="return true;" />
        </li>
      </ul><input name="element_counts" value="4" type="hidden" /> <input name="embed" value="forms" type="hidden" />
    </form> </font>
</div>
<!-- end emf-container div -->              
</div>
<!-- end emf-container-outer div -->
</div>

这是在线表格:http: //nave.net23.net/HTMLPage.html 我想将此表格作为 iframe 放入我的 html 页面中。iframe 代码:<iframe src="http://nave.net23.net/HTMLPage.html" width="645px" height="500px;" frameBorder="0" scrolling="no" ></iframe></div>

如您所见,当我发送表单时,它会自动将我重定向到我之前设置的网站。问题是,当我将代码放入 iframe 标记时,只有 iframe 内的内容在重定向,而不是父页面!我该怎么做才能使父页面刷新?

您可以在此处查看带有 iframe 标记的表单http://nave.net23.net/ 谢谢您的回答...

4

2 回答 2

4

把它放在你的感谢页面中(http://lawb.co.il/thankyou.html):

<script type='text/javascript'>
if (top !== self) top.location.href = self.location.href;
</script>

或者如果你可以修改表单的 HTML,你可以添加一个target="_top"属性(更好的方法)。像这样:

<form target="_top" id="emf-form" class="centerLabel" enctype="multipart/form-data" method="post" action="http://www.emailmeform.com/builder/form/VaHUixmgcX0Qd0BO1a4ho" name="emf-form">
于 2012-09-07T19:47:18.780 回答
0

我认为您正在寻找的是target="_top"属性。

代替:

<form id="emf-form" class="centerLabel" enctype="multipart/form-data" method="post" action="http://www.emailmeform.com/builder/form/VaHUixmgcX0Qd0BO1a4ho" name="emf-form">

和:

<form id="emf-form" class="centerLabel" enctype="multipart/form-data" method="post" action="http://www.emailmeform.com/builder/form/VaHUixmgcX0Qd0BO1a4ho" name="emf-form" target="_top">

这将告诉表单重定向父页面而不是 iframe。

于 2012-09-07T19:45:05.580 回答