• Post Reply Bookmark Topic Watch Topic
  • New Topic

Auto Submit  RSS feed

 
Pol Appan
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I have a JSP page contains two elements and parameters, I want the page to submitted automatically rather than the user clicking the submit button.

Any help is highly appreciated.

Thanks

Ponic
 
Mark Vedder
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some event will have to happen in order for the page to submit. You can use one of the various event trigger attributes of many (X)HTML tags (such as onfocus, onblur, onkeydown, onchange, etc) to call a Javascript function which calls the submit function of the form DOM object. You could also just use a Javascript timer to cause the page to submit (the timer expiring becomes the event which calls the form's submit() function).

That's how it can be done technically. The bigger question becomes one of UI (User Interface) and user experience. Why is this page automatically submitting? How is this going to affect your users' experience? If this is a form the user is filling out, remember you are breaking a paradigm (clicking the submit button) that users are accustom to; you need to have a good reason for doing such, or users will get very frustrated and/or confused.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!