我通过Email-Me表单构建了一个联系表格,其中包含以下HTML代码:
<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中的内容只是重定向,而不是PARENT页面! 如何刷新父页面?
您可以在此处使用iframe标记查看表单http://nave.net23.net/ 谢谢你的回答......
答案 0 :(得分: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">
答案 1 :(得分: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。