SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2007
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Controling readonly attribute of Radio button

    Hi All,

    I have this code:

    Code:
    <input name="payment" id="payment_visa" type="radio" value="visa"> Visa
    <input name="payment" id="payment_paypal" type="radio" value="paypal"> Paypal
    I want to use this JavaScript code to make ReadOnly attribute TRUE for PayPay.

    Code:
    <a href="#" onClick="document.getElementById('payment_visa').readOnly=true;">Only visa...</a>
    But it does not work. Please help...

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The "readOnly" property only applies to text and password fields. Use the "disabled" property instead.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2007
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile

    thank you


Bookmarks

Posting Permissions

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