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
    New to the CF scene
    Join Date
    Oct 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    paste problems in textbox

    I recently came across a Javascript date validation script (http://javascript.internet.com/forms/format-date.html).

    However when you try and paste a date into the field it cuts of the last 2 characters on the end. The onKey event for the field reacts to the Ctrl+V as 2 invalid characters being submitted to the script and strips the last two characters off.

    Any ideas of a workaround?

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,079
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    Try this (kludge??):-

    <td>
    <input type="text" name="testDateFormat1" size='10' maxlength="12" onFocus="javascript:vDateType='1'" onKeyUp="DateFormat(this,this.value,event,false,'1')" onBlur="DateFormat(this,this.value,event,true,'1')">
    </td>

    and the same in the two other input boxes.
    But I have only tested this roughly.

  • #3
    New to the CF scene
    Join Date
    Oct 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The problem is that the max length needs to be 10.


  •  

    Posting Permissions

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