aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Radio Select and Other Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Radio Select and Other" Watch "Radio Select and Other" New topic
Author

Radio Select and Other

William Rouse
Ranch Hand

Joined: Apr 12, 2006
Posts: 73
Here is another problem that I don’t know how to do. I have a donation form where I need to except a series of predefined values or an “Other” category for donation to an organization. If the “Other is checked”, the text field becomes active and the user can type in a dollar amount. As anyone worked on this and can show me how to implement this.
Thanks!

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60048
    
  65

A change handler on the button detects when the button changes state, and if checked, enables the text field.

You need to learn:

1) How to attach and write event listeners

2) Find elements by id

3) Modify the properties of elements found in (2)



[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
William Rouse
Ranch Hand

Joined: Apr 12, 2006
Posts: 73
Thanks!
I now know where to start.
WBR
William Rouse
Ranch Hand

Joined: Apr 12, 2006
Posts: 73
I did not think I need JavaScript, but this seems to work OK, do you notice if I will get myself introuble later on:
William Rouse
Ranch Hand

Joined: Apr 12, 2006
Posts: 73
Also how can I find the number of radio buttons with out couting them myself, in case I have to change the quanties. I don't like the idea of counting since I could introduce an error.
Thank you for pointing out what analyze Bear Bibeault. As an aside I have wondered how to prounce your last name.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
The forum's search is a good place to find simple queries like your last one: http://www.coderanch.com/t/115796/HTML-JavaScript/inconsistency-radiobutton

Eric
William Rouse
Ranch Hand

Joined: Apr 12, 2006
Posts: 73
OK, got it and hopefully remember.
WBR
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60048
    
  65

William Rouse wrote:As an aside I have wondered how to prounce your last name.

Impossible without a French-Canadian accent.

The closest Anglicized pronunciation is something along the lines of Bih-boo, but that's only an approximation. Some of my relatives have adopted the (in my opinion, crass) pronunciation of Bee-Bo. I prefer to keep it closer to the original.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Radio Select and Other
 
Similar Threads
Submit Form
fieldset alignment
IE doesn't return value of submit button?
JSP <a href> tags breaks page functionality
fieldset and form problem