• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Radio Select and Other

 
William Rouse
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)


 
William Rouse
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
I now know where to start.
WBR
 
William Rouse
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, got it and hopefully remember.
WBR
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic