SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2012
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with jQuery to disable input fields using select options

    Hey guys,

    I'm having trouble getting some jQuery to work and was wondering if someone could help me out. I've got a select with two options and 3 input fields as you can see from the jsfiddle file below.

    http://jsfiddle.net/x5mfX/1/

    What I'd like to do is have some jQuery which when 'option1' is selected, then all three input fields (data1, data2 and data3) become disabled and a class of 'disabled' is added to all three of them. However if 'option 2' is selected, then all three data fields remain the same and data can be inputted into them.

    Thanks in advance.

  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,191
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    See the following jsFiddle link for a working version of what you need the drop down to accomplish.

    http://jsfiddle.net/x5mfX/3/


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
  •