• 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

Radio Select and Other

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!

 
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
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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The forum's search is a good place to find simple queries like your last one: https://coderanch.com/t/115796/HTML-JavaScript/inconsistency-radiobutton

Eric
 
William Rouse
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, got it and hopefully remember.
WBR
 
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

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic