Aug 03, 2012, 8:59 PM
[CLOSED] How to set a field status to not valid
Hi,
Can you please show me how to mark a field not valid? My JS below checks if the End date field is less than a Begin date field, if so, I need
to mark the End date field invalid and prompt the user to enter a date that is greater than the Begin date. So far I tried using "markInvalid" but
it didn't work - it didn't wrap around the End date field in red lines to indicate the field is NOT VALID.
Can you please show me how to mark a field not valid? My JS below checks if the End date field is less than a Begin date field, if so, I need
to mark the End date field invalid and prompt the user to enter a date that is greater than the Begin date. So far I tried using "markInvalid" but
it didn't work - it didn't wrap around the End date field in red lines to indicate the field is NOT VALID.
var CheckDateRange = function(){
// Validate date range: End Date/Time must be greater than Start Date Time
var end = Date.parse(#{dtWrapEndDate}.rawValue + " " + #{tfWrapEndTime}.value);
var start = Date.parse(#{dtWrapStartDate}.rawValue + " " + #{tfWrapStartTime}.value);
if(start >= end || end == 'NaN')
{
#{dtWrapEndDate}.focus();
#{dtWrapEndDate}.markInvalid("Invalid End date");
Ext.Msg.notify("Invalid Range", "End Date Time must be greater than Start Date Time");
return false;
}
return true;
}
Last edited by Daniil; Aug 07, 2012 at 1:39 PM.
Reason: [CLOSED]