当向页面 A提交搜索表单以将搜索表单转发到页面 B到其 iframe 并在 iframe 中加载带有搜索结果的页面 B时,是否有可能?
实际上,如果我在页面 A上搜索,它会加载带有结果的 iframe 页面,但我需要在 iframe 中加载带有结果的页面 B。
这是测试页面 A http://mysite.com/lidl/page1.html和页面 B http://mysite.com/lidl/page2.html
第 1 页搜索表单:
<form id="SearchForm" action="http://mysite.com/search-results-jobs/" target="" method="post">
<input type="hidden" name="action" value="search" />
<input type="hidden" name="listing_type[equal]" value="Job" />
<label>
<strong>What?</strong>
<em><input type="text" value="job title, keywords or company name" onblur="if(this.value=='') this.value='job title, keywords or company name'" onFocus="if(this.value =='job title, keywords or company name' ) this.value=''" name="keywords [all_words]" /></em>
</label>
<label>
<strong class="color">Where?</strong>
<b><input type="text" value="city, state or zip code" onblur="if(this.value=='') this.value='city, state or zip code'" onFocus="if(this.value =='city, state or zip code' ) this.value=''" name="City[all_words]" /></b>
</label>
<a href="#" class="SearchForm-link" onclick="document.getElementById('SearchForm').submit()"/>Search</a>
</form>
第2页
<form id="SearchForm" action="http://mysite.com/search-results-jobs/" target="my-iframe" method="post">
<input type="hidden" name="action" value="search" />
<input type="hidden" name="listing_type[equal]" value="Job" />
<label>
<strong>What?</strong>
<em><input type="text" value="job title, keywords or company name" onblur="if(this.value=='') this.value='job title, keywords or company name'" onFocus="if(this.value =='job title, keywords or company name' ) this.value=''" name="keywords[all_words]" /></em></label>
<label>
<strong class="color">Where?</strong>
<b><input type="text" value="city, state or zip code" onblur="if(this.value=='') this.value='city, state or zip code'" onFocus="if(this.value =='city, state or zip code' ) this.value=''" name="City[all_words]" /></b>
</label>
<a href="#" class="SearchForm-link" onclick="one(); two(); three(); four();">Search</a>
<input type="submit" id="btn-search" class="button" value="Cauta"/>
</form>
<iframe id="my-iframe" name="my-iframe" align="right" src="http://mysite.com" frameborder="0" height="100%" scrolling="no" width="100%"></iframe>