I was using HTML component in home page component for advance search functionality in Narrow (Left) Column of Home Layout. My HTML component was
<script language="JavaScript" type="text/javascript">
function setFocusOnLoad() {}
function submitSearchForm(){
var searchField = document.getElementById('advsearchfield');
document.advsrch.action = '/search/SearchResults?searchType=2&sen=0&setLast=1&str=' + encodeURIComponent(searchField.value);
return true;
}
</script>
<form name="advsrch" method="post" onsubmit="return submitSearchForm();">
<input class="searchTextBox" id="advsearchfield" maxlength="80" size="18" name="sbstr" />
<input class="btn" value=" Go! " type="submit" />
</form>
Now that component is not visible in Summer 15 org, so for the workaround I have created visualforce component and create VF page, below is my code of VF page
<apex:page >
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" />
<apex:includeScript value="{!$Resource.advSearch}"/>
</apex:page>
advSearch.js (Static Resource) is
$(document).ready(function () {
function setFocusOnLoad() {}
function submitSearchForm(){
var searchField = document.getElementById('advsearchfield');
document.advsrch.action = '/search/SearchResults?searchType=2&sen=0&setLast=1&str=' + encodeURIComponent(searchField.value);
return true; }
$form = $("<form/>",{name:"advsrch"},{method:"post"},{onsubmit:"return submitSearchForm();"} );
$form.append('<input class="searchTextBox" id="advsearchfield" maxlength="80" size="18" name="sbstr" />');
$form.append('<input class="btn" value=" Go! " type="submit"/>');
$('body').append($form);
});
After doing all the changes, I have found couple of issues
1) Its not showing the blue container as it is now VF component. Requirement is to show the advance search text field and button in blue container just like other components.
2) Its not calling the function same way as it was before, now it refreshing the whole page and not going link which I am providing.
Not sure what am I missing or whats need to be done. Any help would be appreciated.
Thanks much