Show Bid Request
ASP Date Validation
Bid Request Id: 37024
|
|
|
Description:
If the user enters an EndDate that is <= the BeginingDate, the code enters an infinite loop. This is what needs to be corrected! Any other problem you may notice and bring to our attention will be appreciated.
There are two textboxes defining a date range that need to be validated so that when the user leaves the textbox it contains a valid date and the end date is greater than the begining date. Currently, this is fired off the onBlur event and the code is
function checkDate(formField){
var theDate, isValid;
theDate = formField.value;
isValid = CheckValidDate(theDate);
if (isValid){
if (theDate.length > 0)
formField.value = FormatDate(theDate,'MM/DD/YY');
isValid = checkValidDates();
}
if (!isValid) {
alert("Invalid Date Entered");
formField.select();
formField.focus();
return false;
}
}
function newDate(passedValue) {
var makeDate = new Date();
var firstSlash=passedValue.indexOf("/");
var lastSlash=passedValue.lastIndexOf("/");
var month=passedValue.substr(0,firstSlash)-1;
var day=passedValue.substring(firstSlash+1,lastSlash);
var year=passedValue.substr(lastSlash+1);
var newDate = new Date(year,month,day);
return newDate;
}
function checkValidDates(){
var s = newDate(document.myForm.startDate.value);
var e = newDate(document.myForm.endDate.value);
// Check That The End Date Is After The Start Date
if (s.getTime() >= e.getTime())
return false;
return true;
}
And the HTML is
<input CLASS="SmallInput" TYPE="TEXT" NAME="startDate" VALUE="<%= Date %>" SIZE="8" onBlur="checkDate(this)">
<input CLASS="SmallInput" TYPE="TEXT" NAME="endDate" VALUE="<%= EndDate %>" SIZE="8" onBlur="checkDate(this)">
More details can be made available.
Deliverables: 1) Complete and fully-functional working code that meets the stated criteria.
2) Complete ownership and distribution copyrights to all work purchased.
Platform:
This must run on IIS.
Must be 100% finished and received by buyer on:
Dec 2, 2002 EDT
Deadline legal notes: All times are expressed in the time zone of the site EDT (UT - 5). If the buyer omitted a time, then the deadline is 11:59:59 PM EDT on the indicated date.
Remember that contacting the other party outside of the site (by email, phone, etc.) on all business projects < $500 (before the buyer's money is escrowed) is a violation of both the software buyer and seller agreements.
We monitor all site activity for such violations and can instantly expel transgressers on the spot, so we thank you in advance for your cooperation.
If you notice a violation please help out the site and report it. Thanks for your help.
|
|
Bidding/Comments:
|
All monetary amounts on the site are in United States dollars.
Rent a Coder is a closed auction, so coders can only see their own bids and comments. Buyers can view every posting made on their bid requests. |
See all rejected bids (and all comments)
Name |
Bid Amount |
Date |
Coder Rating |
|
|
|
This bid was accepted by the buyer!
|
$10 (USD)
|
Nov 26, 2002 8:02:24 PM EDT
|
10
(Excellent)
|
|
|
Hello I have worked for such kind of problem several times. aand this time also I will do it well.
M/S Chand Enterprises
Senior Software Architect
|
|
|
|
|
|