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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:39:20+00:00 2026-06-11T01:39:20+00:00

I have a MultiDatesPicker control where the user can select some dates. A textarea

  • 0

I have a MultiDatesPicker control where the user can select some dates.
A textarea object filled automatically with dates, while the user selects some of them. Everything is working fine.
What I liked to do now is, to check the length of that textarea so when the length is > 60 to change its width to 200px and when is <=60 the width will be 90.
I have done the following:

 <script type="text/javascript">
    $(document).ready(function () {
        $.datepicker.setDefaults($.datepicker.regional['el']);
        $('#cPublDates').multiDatesPicker({
            altField: '#tbPublishDates'
        });
        $(function () {
            $('#tbPublishDates').change(function () {
                alert('changed');
                if ($(this).val().length > 60) {
                    $(this).width(200);
                } else {
                    $(this).width(90);
                }
            });
        });
    });
</script>

and the objects are

        <div class="pulicationBox">
        <span id="cPublDates"></span>
        <asp:TextBox ID="tbPublishDates" runat="server" ClientIDMode="Static"  TextMode="MultiLine" Rows="5" Width="90px" />
    </div>

but didn’t work because the change() event is not fired. The #tbPublishDates is the id of the textarea.
Any ideas or code correction would be welcome since I am newbie in jQuery.

Thank you

  • 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-11T01:39:22+00:00Added an answer on June 11, 2026 at 1:39 am

    Probably your problem is because it’s the multidaypicker that adds values to the textarea, hence jquery change() won’t trigger. I’d suggest you to use the multidatepicker event onSelect() to instead check the length of the textarea.

    <script type="text/javascript">
    $(document).ready(function () {
    $.datepicker.setDefaults($.datepicker.regional['el']);
    $('#cPublDates').multiDatesPicker({
        altField: '#tbPublishDates',
        onSelect: function(){
            alert('changed');
            if ($('#tbPublishDates').val().length > 60) {
                $('#tbPublishDates').width(200);
            } else {
                $('#tbPublishDates').width(90);
            }
    
       }
    });
    

    });

    See the http://multidatespickr.sourceforge.net/ documentation.

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

Sidebar

Related Questions

Have some dates in my local Oracle 11g database that are in this format:
have written this little class, which generates a UUID every time an object of
Have deployed numerous report parts which reference the same view however one of them
have anyone can tell me what syntax error on this actionscript (actionscript3.0)? var rotY:
Have some code: using (var ctx = new testDataContext()) { var options = new
have some headers like: HTTP/1.1 100 Continue HTTP/1.1 302 Found HTTP/1.1 200 OK HTTP/1.1
Have one Doubt In MVC Architecture we can able to pass data from Controller
Have some validating problems which seem to appear only when using the Auth component.
Have just got a surprise and would appreciate some suggestions. The simple query below
Have you used the Perl 5.10 backtracking control verbs in your regexes yet? And

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.