• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How to send multiple actions to Action class after disabling JavaScript

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have 3 actions (Buttons) in my screen. I have a requirement that we still need to send the request to Action class even after Javascript is disabled

Currently i am doing the following

<html:form method="post" action="a.do">



<%-- Now i have 2 more Buttons --%>
<html:reset value="Reset" ..... onclick = "javascript:clear(form) "/>
<html:submit value="Submit" ..... onclick = "javascript:submitAction()"/>
</html:form>

if the JavaScript is disabled, both the buttons will not work. I want to send them in "action" attribute it self. How do i do that? Can someone help me?

Thanks,
Raj
 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I want to send them in "action" attribute it self.



What do you mean by "them" and "action"?
I think you could do submit without JavaScript?

If you want to check if JavaScript is enabled/disabled in JSP there is one idea:
Put hidden field with value="false". You can name it javaScriptEnabled. Now, write some JavaScript function and try to change the value of this hidden field to "true".
If JavaScript is enabled it will work and change value to true, if not - value remains as false. I think you could put it on your initial jsp or somewhere before this jsp - then you could for example put this value in session.

Mind, this should be tested first if it works like I think it is

 
money grubbing section goes here:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic