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 8418603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:22:47+00:00 2026-06-10T02:22:47+00:00

Here, I have one drop down with 3 value like 0, 1, 2 and

  • 0

Here, I have one drop down with 3 value like 0, 1, 2 and 5 text boxes.

http://jsfiddle.net/ssthil/j4JZX/3/

when i change the drop down value, from credit card to purchase card or purchase card to credit card that time only i need to clear the entered data. not for from 0 to 1 or 0 to 2.

Added more:

I have 3 drop down value as 0, 1 and 3. And 5 more text boxes are there. By default the drop down value is 0, now i enter the data for that text boxes and i change the drop down value 0 to 1 or 2. This time shouldn’t happen no more changes on those textboxes value. If i select the drop down value from 1 to 2 or 2 to 1, this time data should be clear.

Can anyone help on this required?

  • 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-10T02:22:48+00:00Added an answer on June 10, 2026 at 2:22 am

    Save the previously selected value, compare it with the currently selected value, if there is a transition 2 -> 1 or 1 -> 2, clean up your textboxes:

     $(function(){
         var previousValue = $("select").val();
         $('select').change(function() {
             var currentValue = $(this).val();
             if (previousValue == 2 && currentValue == 1 
                 || previousValue == 1 && currentValue == 2) {
               $("input.textbox").val("");
             }
             previousValue = currentValue;
         });
     })​
    

    Fiddle.

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

Sidebar

Related Questions

Here's the situation I have a webpage which has one drop down called prefer.
Here, the Sencha team explains how to have a one to many relationship: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.data.Store
I have a drop down in one of my views, allowing me to select
In my application I'd like to have a drop-down box to choose a table
So I have two filtering objects. One is a drop down list, which chooses
I have a drop down list (yii framework) , that i would like to
I have two drop down menus, one of which I am trying to replace
I have one HTML page with one toggle button and some drop down item.
I have a really simple menu that I'd like to add a drop-down. What
Here is my situation: I have one table that contains a list of drugs

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.