Click to See Complete Forum and Search --> : Checking Date field for anything


rculver
03-12-2003, 03:31 PM
We are trying to see if a user input anything in a date field. The snippet code is
if (ele[i].name.match(/dueDate.+)){
dueDateVar = ele[ele[i].name];
if dueDateVar.value.length == 0) {
set value to 0;
}
else {
set value to 1;
}
}

Right now it is always setting it to 1 whether there is something there or not.

We are using a calendar popup to input the date.

khalidali63
03-12-2003, 05:31 PM
Some one might understand your question but I think it needs more description as for the code is concern

Khalid

Dan Drillich
03-12-2003, 06:55 PM
If all you want is to check whether anything was entered in the date field, the following will suffice -


var dueDateVar = ele[ele[i].name];
if (dueDateVar.value.length == 0) {
value = 0;
}
else {
value = 1;
}

rculver
03-13-2003, 06:17 AM
Thanks for all your help.:)