• 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

Enabling/Disabling buttons in JSP

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Is ther any ways to enable/disable buttons in JSP, based on the value what i select in the combobox ??
i.e) If i select the value "Yes" in the combobox, corresponding buttons
should be enabled and
If i select the value "No" in the combobox, corresponding buttons
should be disabled.
I'm using Struts framework for my application.

Suggestions are welcome.

thanks
Vikas
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The best way to do this is with JavaScript. By specifying the "onchange" event in your <html:select> tag, you can cause the execution of a function that will disapble or enable buttons on your form. If you don't know enough about JavaScript to do this, I'd suggest spending some time with JavaScript tutorials before attempting it.
 
vikas bala
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Merrill.

I tried to do this is with JavaScript.
By specifying the "onchange" event in the <html:select> tag,

However, I'm using <html:button> and I see its not enabling/disabling dynamically based on the combobox value.

vikas
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is probably due to an error in your JavaScript code. Please show us the code.

Hint: If you specify styleid="button1" for an html:button, you can then use the statement:

to disable the button.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic