This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring Boot in Practice and have Somnath Musib on-line!
See this thread for details.
Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Auto form submit with parameter from URL not working in IE

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:




reply
    Bookmark Topic Watch Topic
  • New Topic