Click here to Skip to main content
15,886,782 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: url from textbox in iframe Pin
musefan5-Jan-11 23:22
musefan5-Jan-11 23:22 
GeneralRe: url from textbox in iframe Pin
dlog1976-Jan-11 1:29
dlog1976-Jan-11 1:29 
GeneralRe: url from textbox in iframe Pin
musefan6-Jan-11 2:09
musefan6-Jan-11 2:09 
QuestionXSL DropDown Pin
manowj24-Dec-10 21:42
manowj24-Dec-10 21:42 
AnswerRe: XSL DropDown Pin
Sunasara Imdadhusen4-Jan-11 22:19
professionalSunasara Imdadhusen4-Jan-11 22:19 
QuestionJavaScript not working for chrome Pin
Varun Sareen20-Dec-10 23:38
Varun Sareen20-Dec-10 23:38 
AnswerRe: JavaScript not working for chrome Pin
phil.o21-Dec-10 0:39
professionalphil.o21-Dec-10 0:39 
QuestionJavaScript Function and Problem with Backspace Button Pin
AndyASPVB10-Dec-10 23:07
AndyASPVB10-Dec-10 23:07 
Hi
I have a javascript function that is applied to a textbox onkeyup so that when a user puts in a date in the format of dd/mm/yyyy it puts in the forward slashes. It also stops the user exceeding ten characters. However, when the user uses the backspace button, whilst the numbers are deleted, unless you keep down on the button, I can't get the backspace button to move back beyond the slashes.

Here is my code, and I have highlighted in bold the bit that is not working:

function DateInputUpdate(input) {                
    if ( input.value.length == 2 || input.value.length == 5 )
        input.value = input.value + dateSep;

       if (input.value.length > dateFormat.length) {
        input.value = input.value.substring(0, dateFormat.length);

       if (event.keyCode == 8) {
         if (input.value.length == 3 || input.value.length == 6) {
            input.value = input.value.substring(input.value.length, input.value.length - 1);
       }
      }
    }
}



Can someone please advise me what I need to do or change? I don't particular wish to delete the slashes, more to ignore them or skip over them that's my ideal solution.

Thanks
AnswerRe: JavaScript Function and Problem with Backspace Button Pin
NeverHeardOfMe10-Dec-10 23:20
NeverHeardOfMe10-Dec-10 23:20 
Questionaspx page functionality call from javascript in html page Pin
ramuksasi9-Dec-10 6:22
ramuksasi9-Dec-10 6:22 
AnswerRe: aspx page functionality call from javascript in html page Pin
Gerben Jongerius9-Dec-10 20:21
Gerben Jongerius9-Dec-10 20:21 
GeneralRe: aspx page functionality call from javascript in html page Pin
Monjurul Habib1-Mar-11 8:30
professionalMonjurul Habib1-Mar-11 8:30 
AnswerRe: aspx page functionality call from javascript in html page Pin
Monjurul Habib1-Mar-11 8:32
professionalMonjurul Habib1-Mar-11 8:32 
Questionregarding jquery effect Pin
Tridip Bhattacharjee1-Dec-10 21:23
professionalTridip Bhattacharjee1-Dec-10 21:23 
AnswerRe: regarding jquery effect Pin
Shahriar Iqbal Chowdhury/Galib2-Dec-10 9:14
professionalShahriar Iqbal Chowdhury/Galib2-Dec-10 9:14 
QuestionHTML Select tag Pin
salmonraju29-Nov-10 23:56
salmonraju29-Nov-10 23:56 
AnswerRe: HTML Select tag Pin
WoutL30-Nov-10 2:22
WoutL30-Nov-10 2:22 
AnswerRe: HTML Select tag [modified] Pin
daveyerwin30-Nov-10 2:29
daveyerwin30-Nov-10 2:29 
AnswerRe: HTML Select tag Pin
Hiren solanki2-Dec-10 1:09
Hiren solanki2-Dec-10 1:09 
QuestionDo you see any errors here? Pin
Ella Corp27-Nov-10 22:51
Ella Corp27-Nov-10 22:51 
AnswerRe: Do you see any errors here? Pin
Not Active28-Nov-10 12:14
mentorNot Active28-Nov-10 12:14 
AnswerRe: Do you see any errors here? Pin
J4amieC29-Nov-10 22:40
J4amieC29-Nov-10 22:40 
AnswerRe: Do you see any errors here? Pin
musefan30-Nov-10 0:49
musefan30-Nov-10 0:49 
QuestionAccess denied for parent.parent.enableclock(); Pin
raghvendrapanda23-Nov-10 19:24
raghvendrapanda23-Nov-10 19:24 
AnswerRe: Access denied for parent.parent.enableclock(); Pin
T M Gray1-Dec-10 8:50
T M Gray1-Dec-10 8:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.