Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Mar 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Prototype.js and radio buttons

    Hi,

    I am doing a form validation using Prototype.js. My problem is validating radio button. I am using Form.Element.Serializers.inputSelector to validate the radio button. I understand that it will return an array. I am wondering how do I go about checking which radio button is checked. Please reply soon.

    Thanks.

  • #2
    Regular Coder
    Join Date
    Aug 2005
    Posts
    282
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you should just use $F(buttonID)
    it will return the selected @value, if any

  • #3
    Banned
    Join Date
    Dec 2005
    Location
    That's a secret.
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    get radio button value with prototype.js

    Instead of:
    var typeValue = $F('type');

    Use this:
    var typeValue = Form.getInputs('myform','radio','type').find(function(radio) { return radio.checked; }).value;

    From Rex Chung:
    http://www.rexchung.com/2007/02/22/g...h-prototypejs/

  • #4
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •