Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts

    Partialy disabled text feild

    Is it possible to have a text field with '2005' in it, but only the '05' is changable, and the '20' is disabled, (read only)
    If I'm postin here, I NEED YOUR HELP!!

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    United Kingdom Confused: Often
    Posts
    859
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Several suggestions...

    Not as far as I know of... although there are a couple of other ways to accomplish a similar effect. How about having the 20 outside the text box? Like so:

    Code:
    20<input type="text" name="year" value="05" size="2" maxlength="2"/>
    That way you'll still have the text there and the user still knows it needs to be a 20-- year. This is the way I'd recommend you go...

    Otherwise, you could use a select box with all the years 2000 - 2099 in. The disadvantage is that it's gonna end up a huge box... but you do limit the responses that the user can provide.

    But, if you're still not content with either of the above solutions and still wanted the 20 to appear to be in the same box as the text you could stick it in there as a background image and then apply some padding to the text box so they cant type over it. Alternatively you could relatively position some the 20 in there like this:
    Code:
    <input type="text" name="year" value="05" size="4" maxlength="2" style="padding-left: 20px;"/>
    <div style="position: relative; left: 5px; top: -20px">20</div>
    This is not a very user friendly approach as the user will think that they can edit the text when really they cant as it's an image anyway... but it's entirely up to you.

    Let me know if that helps or if you have any further problems.

    Last edited by redhead; 03-05-2005 at 12:24 PM.
    redhead

  • #3
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts
    Sorry i didnt reply soon. I needed to set my computer back up after a LAN, and was limited to one hand. I will try the image solution. I think it could be user friendly if its greyed out. ill Let you know.
    If I'm postin here, I NEED YOUR HELP!!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •