SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2012
    0 Post(s)
    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.

    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
    Melbourne, AU
    17 Post(s)
    1 Thread(s)
    See the following jsFiddle link for a working version of what you need the drop down to accomplish.
    Blog/Portfolio | Evolution Xtreme | DFG Design | DFG Hosting | CSS-Tricks | Stack Overflow | Paul Irish
    Having lame problems with your code? Let us help by using a jsFiddle


Posting Permissions

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