Hi,
I have to submit a search form on page onload if the parameter is provided in the page URL.
The search form contains a drop down of id 'searchByCountry'. If we I provide 'searchByCountry=Australia' as below in the URL, the JS code should picks this value and form will be auto submitted. However, parameter is not provided in URL, the search page will only load and user will select the value from the from and then submit it.
Page URL:
Tried below both URL with & followed by amp;' and '&' in the URL.
http://www.test.com/sss/index.jsp?hostname=http://www.test.com&searchByCountry=Australia
Issues I am facing:
1. In FireFox, the form picks the value for countryCountry from the URL and page get submitted automatically, however, it first displays the search page 'index.jsp' and then it goes to submitted page showing search result.
Is it possible to directly display the submitted form?
2. In IE, the auto form submit works, however, it DOESN'T pick the value from URL and displays the result for blind search irrespective of the parameter from URL.
Can some one please help me on this page? How can we make the code functional in cross browsers?
JS code:
JS call in my
JSP: