Click here to Skip to main content

JavaScript

 
AnswerRe: jquery tabslideout plugin and wired behavior PinmemberMayor Daily17-Dec-12 5:22 
GeneralRe: jquery tabslideout plugin and wired behavior PinmemberTridip Bhattacharjee18-Dec-12 1:55 
QuestionNeed help understanding binding PinmemberSteve Bondy7-Dec-12 15:00 
QuestionText replace Pinmemberrakeshs3127-Dec-12 0:06 
I have a text box andit will accept only time in the format 00:00(maximum value can be 12:59) . If user enter any of the value greater than this that part only needs to become 00. i have the code like this,but it will change the whole value to 00:00 . In the greater than conditions, what i have to write .
 
function ValidateTimeControl(s, e) {
    var isValid = true;
    if (e.value != null) {
        if (e.value.substring(0, 1).trim() == "" || e.value.substring(1, 2).trim() == "" || e.value.substring(3, 4).trim() == "" || e.value.substring(3, 4).trim() == "") {
            isValid = false;
        }
        else {
            var hours = parseInt(e.value.substring(0, 2), 10);
            var minutes = parseInt(e.value.substring(3, 5), 10);
 
            if (hours > 12) {alert(hours)
                isValid = false;
                
            }
 
            if (minutes > 59) {
                isValid = false;
            }
        }
    }
    else {
        isValid = false;
    }
 
    if (!isValid) {
        e.value = '00:00';
        
    }
}
 
Thanks
Rks
AnswerRe: Text replace PinmvpRichard MacCutchan7-Dec-12 1:43 
GeneralRe: Text replace Pinmemberrakeshs3129-Dec-12 6:40 
QuestionJQuery datePicker SelectMultiple format dd/mm/yy PinmemberxnaLearner6-Dec-12 1:37 
AnswerRe: JQuery datePicker SelectMultiple format dd/mm/yy Pinmembersrinivas nv6-Dec-12 22:50 
GeneralRe: JQuery datePicker SelectMultiple format dd/mm/yy PinmemberxnaLearner10-Dec-12 1:04 
QuestionDelete selected rows by table id using javascript PinmemberMember 88023075-Dec-12 9:05 

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

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


Advertise | Privacy | Mobile
Web04 | 2.8.150327.1 | Last Updated 25 Mar 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid