Submit to other submit page which submits too and load
Is it possible to use javascript to submit from page#1 to another page#2 which submits to the iframe within and then load page#2 with submitted results ?
Page#1 search form:
<form id="SearchForm" action="http://mysite/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>
Page#2
<form id="SearchForm" action="http://mysite/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>
You can use JavaScript on Page 2 to accept the form submission data from Page 1 and populate hidden 'input' tags in the form on Page 2. Then the combined data in the form on Page 2 can be sent to the page/document in your <iframe> which will ultimately process everything.
It can be cumbersome, though, because this would require the <form> on Page 1 to use method="get". That means the user data is encoded into a query string that's added to the URL for Page 2, and there are limitations on the size of query strings (among other issues). But I don't see a problem with your example.
Search on "javascript prepopulate forms" and you'll find some good advice.
Bookmarks