Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7920477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:14:05+00:00 2026-06-03T16:14:05+00:00

Using a Jquery plugin called filestyle from: http://www.appelsiini.net/projects/filestyle . I have a select box

  • 0

Using a Jquery plugin called filestyle from: http://www.appelsiini.net/projects/filestyle. I have a select box with an id of adtype. If the selected option has a value of 7, it’ll disable the file input with the id of ‘adfile’.

The problems becomes when a user has already selected a file. I cant find a way to clear the file input and then disable it. $(‘#adfile’).val(”); does not work.

JQUERY

$(function(){
  $('#adtype').change(function(){
    if($('#adtype option:selected').val()==="7"){
      $('#adfile').val('');
      $("#adfile").prop('disabled', true);
    }else{
      $("#adfile").prop('disabled', false);
    }
  });
});

HTML

<form id="someform" action="somepage" method="post">
  <select name="selectstuff" id="adtype">
    <option value="1">one</option>
    <option value="5">five</option>
    <option value="7">seven</option>
  </select>

  <input type="file" id="adfile" value="" />

  <input type="submit" value="submit" />
</form>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T16:14:07+00:00Added an answer on June 3, 2026 at 4:14 pm

    I used
    $('#adfile').val(''); and $('#adfile').attr('disabled', 'disabled');

    DEMO

    NOTE: filestyle plugin removes id,name attributes from the file input element and adds file as class. I’m accessing this element with reference to the form.

    Hope this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using a jquery plugin from [ FilamentGroup ] called DateRangePicker. I have
I'm using a jQuery plugin called qTip (http://craigsworks.com/projects/qtip/docs/api/#callbacks) and trying to implement a callback
I am using jquery validation plugin 1.9.0 . I have downloaded the plugin from
I am using the jquery validation plugin from: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ How can I add a
I have been using a jquery plugin called uploadify for handling file uploads as
I am using this new jQuery plugin called jsTree www.jstree.com and using the HTML
I'm using a jQuery plugin called Colorbox (http://colorpowered.com/colorbox/) and loading content via Ajax. This
OK, so I am using a jQuery plugin called CountUp: http://blog.ogulcanorhan.com/weekend-project-jquery-countup-plugin/ The script is
I am using jQuery plugin called GalleryView, in its Beta3 version (http://spaceforaname.com/galleryview). The Beta4
I am using jQuery plugin called jsPlumb - http://jsplumb.org/jquery/demo.html and I want to connect

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.