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

  • Home
  • SEARCH
  • 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 3943374
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:46:28+00:00 2026-05-20T00:46:28+00:00

How do I properly disable and enable form elements using jquery. I need to

  • 0

How do I properly disable and enable form elements using jquery. I need to disable the text form element when I click on the select. And vise versa.

<html>
    <head>
    <script src="jq.js"></script>
    <script>

    $(function(){

    $('#fromdate').click(function(){
        $('#yosh').attr('disabled','disabled');
        $('#fromdate').removeAttr('disabled');
    });

    $('#yosh').click(function(){
        $('#yosh').removeAttr('disabled');
        $('#fromdate').attr('disabled','disabled');
    });

    });
    </script>

    </head>
    <body>
    Sort by:
    <select name="yosh" id="yosh">
    <option value="daily">daily</option>
    <option value="weekly">yesterday</option>
    <option value="weekly">weekly</option>
    <option value="monthly">monthly</option>
    <option value="yearly">yearly</option>

    </select><br/>
    date range:<br/>

    From:<input type="text" value="" name="fromdate" id="fromdate"></input><br/>
    To:<input type="text" value="" name="todate" id="todate"></input><br/>


    Customer:<input type="text" value="" name="customer" id="customer"></input>

    </body>

    </html>
  • 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-05-20T00:46:29+00:00Added an answer on May 20, 2026 at 12:46 am

    Example of what i’ve written in the comment:

    <span id="spnSel">
        <select name="yosh" id="yosh">
            <option value="daily">daily</option>
            <option value="weekly">yesterday</option>
            <option value="weekly">weekly</option>
            <option value="monthly">monthly</option>
            <option value="yearly">yearly</option>
        </select>
    </span>
    

    Add this event:

    $('#spnSel').mouseover(function () {
       $('#yosh').prop('disabled', false);
    });
    

    You can do this for the text boxes as well. This may not be the best solution/approach but it will do the job.

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

Sidebar

Related Questions

I'm having trouble getting the RelayCommand to enable/disable the attached control properly. I've got
Is there an easy way to enable or disable an IFrame to take it
I've got a form_for form, and within it, I'm using a form helper check
I'd like to bind dynamic properties to WinForms control properties. In the following example
I'm making a vibrate toggling widget (in fact, its first version is already in
So i have a ASP.NET 4 Custom Control called SafeClickButton which is designed to
Greeting; I have asp.net dropdownlist control with Ajax CascadingDropDown control. I also I have
I know there's a property to add in the beginning of the macro so
I know there is a property or method that makes the scrollview/uiview call drawRect:
I have the javascript code below which disables an asp.net button during page postback.

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.