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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:55:45+00:00 2026-05-26T06:55:45+00:00

<input id=studentnoofinst type=text size=20 value=/> <select id=studentinst size=6> <option value=1>First Installment</option> <option value=2>Second Installment</option>

  • 0
 <input id="studentnoofinst" type="text" size="20" value=""/>
<select id="studentinst" size="6">
<option value="1">First Installment</option>
<option value="2">Second Installment</option>
<option value="3">Third Installment</option>
<option value="4">Fourth Installment</option>
<option value="5">Fifth Installment</option>
<option value="6">Sixth Installment</option>
</select>

Jquery

 $("#studentnoofinst").keyup(function() { 

    //$("select option[value='fb']").prop("selected",true);
    alert("going to change");
    $leap=0;
    $leap=($('#studentnoofinst').val());
    if($leap!=''){
    for(i=$leap;i<=6;i++) {// displaying the no of installments 
        if(i!=$leap){
            $('#studentinst option[value='+i+']').remove();

 }
     }    
    }

});

Hi, as shown in the code above i am able to remove the selected row, My question is that i am not able to add the selected option back,How to add the selected row back
P.S:once if enter 4 the last 2 rows are deleted and later if enter 5 only the first 4 rows are display and the 5 row is vomitted.. but it need it

if first time the input =4

ouptut:

  <option value="1">First Installment</option>
  <option value="2">Second Installment</option>
  <option value="3">Third Installment</option>
  <option value="4">Fourth Installment</option>

if second time the input =5

ouptut:

  <option value="1">First Installment</option>
  <option value="2">Second Installment</option>
  <option value="3">Third Installment</option>
  <option value="4">Fourth Installment</option>
  <option value="5">Fifth Installment</option>//vomitted but i need this? add

Live example here: http://jsfiddle.net/PQ7GF/30/

  • 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-26T06:55:46+00:00Added an answer on May 26, 2026 at 6:55 am

    EDIT – merged the changes made by soul:

    you could save the options in a variable and add them back:

    var list = $('#studentinst').html();
    $("#studentnoofinst").keyup(function() {
        $('#studentinst').empty().append(list);
        alert("going to change");
        $leap = 0;
        $leap = ($('#studentnoofinst').val());
        if ($leap != '') {
            for (i = $leap; i <= 6; i++) { // displaying the no of installments 
                if (i != $leap) {
                    $('#studentinst option[value=' + i + ']').remove();
                }
            }
        }
    });
    

    fiddle here: http://jsfiddle.net/PQ7GF/49/

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

Sidebar

Related Questions

input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;} input,textarea,select{*font-size:100%;} This is from the YUI reset css. What does the * before
input type=button name=colr value= Blue onclick=document.bgColor='#0000FF' Basically i have done buttons using javascipt to
input type=text/radio/checkbox - can I treat them differently in my CSS? Other than by
Input: I have a LaTeX file, with plain text & math formulas. Desired output:
Input rz value In the head I have: Event.observe(window, 'load', function() { $$(input).each(function(field){ Event.observe(field,
$('input[type=checkbox]').unbind().click(function(e){ $(this).attr('checked', true) return false; }); I NEED to return false because I have
Input: var str = 'text {{value1}} text {{value2}}text{{value1}}'; Regex: var result = str.match(/({{\S+}})+/ig); Output:
Input: Dynamic Text (PDF 120 KB) Output: Dynamic Text
input XML <root> <garbage> </garbage> <node> <node>TEXT</node> <node>TEXT</node> </node> <node> <node>TEXT</node> <node>TEXT</node> </node> </root>
input field with type file used for browsing file .How to make it for

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.