• 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

enable/disable drop down

 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everyone,

I have two drop boxes in my JSP. When i choose "Yes" in the first drop down, the second drop down should get disabled. When i select "No" then the second drop down should get enabled. I have used struts tag.

How do i implement this?



Thanks
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
disabled does not have a value, it is just disabled and it takes a Boolean not a string when setting it with JavaScript.

Eric
 
Deeps Mistry
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Eric Pascarello wrote:disabled does not have a value, it is just disabled and it takes a Boolean not a string when setting it with JavaScript.

Eric



Hi,
Ok ..so you mean to say i cant set disable as true or false? so can you please suggest me how to go about it?I am stuck

Thanks
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Exactly what I said, disabled does not have a value [attributes].


Eric
 
Deeps Mistry
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Eric Pascarello wrote:Exactly what I said, disabled does not have a value [attributes].


Eric



Hey Eric,

Thanks for your help. I tried setting disabled to false. But it is still not working.

I think there is some problem with this line : var DD2 = document.getElementsByProperty("POTX"); alert(DD2);
because i am not getting alert message for DD2.

Since i am using struts tag, i cannot use ID attribute with <html:select>. I have to use property attribute <html:select property="" >.

So what do i do now. javascript:emoticon('');

function DisableTR(value)
{
alert("hi");
alert(value);
var DD2 = document.getElementsByProperty("POTX");
alert(DD2);
if(value == "No")
{
DD2.disabled = false;
}
}

Thanks
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic