• 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

Associating button with text field

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a small problem here!
I have to add two radio buttons in my page and it should be so that when I click one radio button some text fields become active otherwise it remains inactive.

Can you please tell me how I can do that?
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try using "disabled" attribute, which takes boolean value in the respective html tag.

try searching for examples on this, you will get many.
[ September 19, 2008: Message edited by: Bear Bibeault ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'll need to use JavaScript to detect the state changes, and set the disabled attribute as appropriate.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Sch�n Sinn:
Try using "disabled" attribute, which takes boolean value in the respective html tag.


No, that's not correct. The disabled attribute takes no value in HTML, and in XHTML any value will turn the attribute on.

in XHTML, the customary notation is:but will also cause the element to be disabled! So no, it's not a boolean value.
[ September 19, 2008: Message edited by: Bear Bibeault ]
 
Devi Taruni
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Bear Bibeault,
I was actually talking about the attribute 'disabled' from struts-html tag library.
eg:
<html:text property="xProperty" disabled="${myBean.disabled}" />


where disabled attribute takes an expression which should result in a boolean value. Hope this makes things clear.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Sch�n Sinn:
Hope this makes things clear.

No, it doesn't. The original poster said nothing about using Struts. You also said "which takes boolean value in the respective html tag", which is incorrect. The value is not Boolean in the html tag.

Please do not bring up Struts tags outside of the Struts forum. Thanks.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Sch�n Sinn", please check your private messages for an important administrative matter.
 
Devi Taruni
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Bear,

I apologize for my posting which you meant was inappropriate. May be it was an oversight not mentioning which html tag I was refering to. Thanks for correcting.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Sch�n Sinn:
May be it was an oversight not mentioning which html tag I was refering to

Not to derail his topic further, but there's only one html tag. A Struts tag is not an html tag.

Also, please read your private messages again. My request in that message is not a suggestion.
 
There is no "i" in denial. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic