Forum Moderators: open
I am working on an AJAX Component Art grid and I have a seperate search bar on top with 5 filters. 3 of them being dropdown lists, one a textbox and one a textbox with a small calender icon next to it to select a date. All filters are working except the date textbox with the small calender. Below is my javascript client side script for filtering:
[codes]
function CandidateSub_Search()
{
var filter = "";
if (document.all.<%=txtName.ClientID%>.value != '')
{
filter = "FullCandidateName LIKE '%" + document.all.<%=txtName.ClientID%>.value + "%'"
}
//if status is not selected return all values i.e. %
if (document.all.<%=ddlStatus.ClientID%>.options[document.all.<%=ddlStatus.ClientID%>.selectedIndex].value != '%')
{
//add AND to append to the previous filter
if (filter.length > 0)
{
filter = filter + " AND "
}
filter = filter + "StatusID = " + document.all.<%=ddlStatus.ClientID%>.options[document.all.<%=ddlStatus.ClientID%>.selectedIndex].value
}
if (document.all.<%=ddlPractice.ClientID%>.options[document.all.<%=ddlPractice.ClientID%>.selectedIndex].value != '%')
{
//add AND to append to the previous filter
if (filter.length > 0)
{
filter = filter + " AND "
}
filter = filter + "PracticeID = " + document.all.<%=ddlPractice.ClientID%>.options[document.all.<%=ddlPractice.ClientID%>.selectedIndex].value
}
if (document.all.<%=ddlProcessingStatus.ClientID%>.options[document.all.<%=ddlProcessingStatus.ClientID%>.selectedIndex].value != '%')
{
//add AND to append to the previous filter
if (filter.length > 0)
{
filter = filter + " AND "
}
filter = filter + "ProcessingStatusID = " + document.all.<%=ddlProcessingStatus.ClientID%>.options[document.all.<%=ddlProcessingStatus.ClientID%>.selectedIndex].value
}
if (document.all.<%=txtDateSubmitted.ClientID%>.value!='')
{
if (filter.length > 0)
{
filter = filter + " AND "
}
filter = filter + "LastUpdated >= " + document.all.<%=txtDateSubmitted.ClientID%>.value;
}
alert(filter);
CandidateSubmissionGrid.filter(filter);
}
[/codes]
Basically, my "LastUpdated" column in the DB is a date column with dates for the last update. Basically, I want to put in a date in the textbox (or choose from the calender) and when I click on search, I want it to show all records in the grid after the date I entered into the textbox. Hopefully i'm clear in all this. The last filter is the one for dates...and for clearer reading purposes, i'll paste it down below again.
if (filter.length > 0)
{
filter = filter + " AND "
}
filter = filter + "LastUpdated >= " + document.all.<%=txtDateSubmitted.ClientID%>.value;
}
Any input or help would be highly appreciated. Thank you in advance.
Regards,
S