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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:55:02+00:00 2026-05-25T10:55:02+00:00

So I have this jsfiddle . I have two jquery ui plugins witch gives

  • 0

So I have this jsfiddle. I have two jquery ui plugins witch gives these two input fields values. So the user is not ment to edit the fields manually therefore they are set to readonly.

Now to the problem, is there a way for me to change the width of the input fields dependent of the content size? Setting just the width in css to say 300px or so will maybe work for Septemember, but if the user choses some other month like May then it needs to be alot less then 300px.

  • 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-25T10:55:02+00:00Added an answer on May 25, 2026 at 10:55 am

    Check this out: http://jsfiddle.net/SSBYG/30/

    What I did is to count all the characters and then set the width based on the results

    date.style.width = (date.value.length * 7) + "px";
    time.style.width = (time.value.length * 7) + "px";
    

    Note: if you are going to use that a lot and not just 2 times, it will be good idea to make a function

    This is also useful: jQuery count characters and add class

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

Sidebar

Related Questions

I have this script: http://jsfiddle.net/NV2uV/ It works, but I do not like it. Cons:
In this JSfiddle have I two forms. This is duplicated twice <form action= method=post>
I have an ASP.NET MVC application and I am using two JQuery plugins: colorbox
I have a jquery function which replaces a Link within two values with an
http://jsfiddle.net/AYPze/9/ In this example I have two similar divs with the same goal. Bind
I have the following code. I want to add two input fields together and
I have this code in jQuery, that I want to reimplement with the prototype
Please see this jsFiddle: https://jsfiddle.net/Wmq6f/ I have a textarea that has a background image,
http://jsfiddle.net/9BCrs/5/ I have this set up to load a file into a DIV using
In the code below I have two jQuery selectors that seem to work correctly.

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.