• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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:




 
The fastest and most reliable components of any system are those that are not there. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic