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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:37:59+00:00 2026-06-14T06:37:59+00:00

I have a little issue. I have a select with options. When one option

  • 0

I have a little issue. I have a select with options. When one option is selected, then text changes in textarea, everything is working perfectly while user don’t try to write something in text area, when user types, then text doesn’t change anymore. Here is code:
select with option:

   <select class="es" id="es1">
    <option id="edu1">1</option>
    <option id="edu2">2</option>
</select>

here is jQuery code which I use(in this code I am taking selected option id and then by id number I am showing text, everything is working perfectly)

$('#es1').change(function() {
                    $('#sk1').html('');
                    var id = $(this).children(":selected").attr("id");
                    var idd = id.split('edu');
                    var num = idd[1];
                    $('#sk1').html(customTextByNumber[num]);
                });

and I have text area with id=”sk1″. The most interesting is that, when user types something extra into box, when I select other option, text doesn’t change in it, but when I look at inspect element (in google chrome) I can see that text is changing, but after tag. For example when user don’t type everything is showing in html like this:

<textarea id="sk1">text here</textarea>

After user types something extra:

<textarea id="sk1">ecustom text and user text</textarea> Another options text which is not shown to user</textarea>

Maybe you have some ideas how to solve such problem?

SOLVED If someone have such problem use this

$('#sk1').val(something);

instead of this one

$('#sk1').html('something'); (this is bad one)
  • 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-14T06:38:00+00:00Added an answer on June 14, 2026 at 6:38 am

    You need to use the .val() method on textarea:

    $('#es1').change(function () {
        $('#sk1').val(''); // This line is probably unnecessary...
        var id = $(this).children(":selected").attr("id");
        var idd = id.split('edu');
        var num = idd[1];
        $('#sk1').val(customTextByNumber[num]);
    });​
    

    I don’t know what customTextByNumber is, but it should work after editing the text in the textarea.

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

Sidebar

Related Questions

I have a little issue, if i select an single checkbox and press f5
I have a little issue with my hibernate logging configuration. In our application, we
I have a little issue with my CSS: I have a hyperlink element which
I have a little issue concerning an animation-effect which loads a certain div into
Hey guys I have a little issue here. I have a panel where I
im having a little issue here. I have MediaElement.js set on my project. It
I have a little problem with javascript form submit issue, here is the script
I have a little bit of an odd issue. When I run this SQL:
I have a little issue with setting an image to a list view using
Hey guys, I have a little issue here. I need my users to be

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.