Welcome to Dream.In.Code
Getting Help is Easy!

Join 109,296 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,218 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



From Date/To Date Issue

 
Reply to this topicStart new topic

From Date/To Date Issue

jjsaw5
post 7 Aug, 2008 - 07:45 AM
Post #1


D.I.C. Face

Group Icon
Joined: 4 Jan, 2008
Posts: 979



Thanked 5 times

Dream Kudos: 125
My Contributions


Here is the issue that I am having. I have two text feilds where users need to enter a "From Date:" and a "To Date:" they then hit a update button and my code will pull back the data for the date ranges they have selected.

If the user enters the same date in both from and to fields they are expecting to see just one row returned for that day, BUT what is really happening is it is returning all the data.

Does anyone have any suggestions or ideas on how I can just have one row return if the users enter the same date?


CODE
<script language="javascript">

function submit() {

    var fundshareid = document.getElementById('fundshareid').value;
    var fd = document.getElementById('fd').value;
    var td = document.getElementById('td').value;

    var tp = "<%=request.getParameter("tp")%>";

    if (tp == null || tp == "null") {tp = "fl";}

    return document.location = "<%=request.getAttribute("baseURI")%>" + "?fd=" + fd + "&fundshareid=" + fundshareid + "&link=products&td=" + td + "&tp=" + tp + "&ut=" + "<%=request.getParameter("ut")%>";

}

function validate(){

    if (isDate(document.forms[1].fd.value)==false){
        document.forms[1].fd.focus();
        return false;
    }
    if (isDate(document.forms[1].td.value)==false){
        document.forms[1].td.focus();
        return false;
    } else {
        fd = new Date(document.forms[1].fd.value);
        td = new Date(document.forms[1].td.value);
        if (fd > td){
            alert("We're sorry, but we are unable to display the requested data.  Please select a \"To Date\" that is greater (more recent) than the \"From Date.\"");
            return false;
        }
    }

return true;
}
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 9/6/08 09:41AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month