ASP/Javascript compatibility problem

Results 1 to 3 of 3

Thread: ASP/Javascript compatibility problem

  1. #1
    ASP Doofus Guest

    Default ASP/Javascript compatibility problem

    My ASP application has session variables for "Last Close of Business, Last End of Week, Month, Quarter, and Year) that I assign to local variables on the problemmatic page, like so:<BR> yesterday = session("LastBussDate")<BR> lastWeek = session("WeekEnd")<BR><BR>The page has a form ("reportDialog") with a select field ("dateChoice") which allows user to select "Last Close of Business", etc. I&#039m trying to get their selection to input the date variable (eg--"10/30/2000") in another text input field called "selectedDate" by calling the "changeDate" javascript function with the selection field&#039s onChange event. I have included the text of changeDate below...<BR><BR> function changeDate () {<BR> var chooser = document.reportDialog.dateChoice.options[document.reportDialog.dateChoice.selectedIndex].value;<BR> switch (chooser) {<BR> case "0":<BR> document.reportDialog.selectedDate.value = yesterday<BR> break<BR> case "1":<BR> document.reportDialog.selectedDate.value = lastWeek<BR> break<BR> case "2":<BR> document.reportDialog.selectedDate.value = lastMonth<BR> break<BR><BR>...<BR> ///You get the point///...<BR><BR> case "5":<BR> document.reportDialog.selectedDate.value = "dd/mm/yyyy" <BR> break <BR> } <BR> }<BR><BR>This function works fine and inputs the correct text for case "5". Unfortunately, the other cases don&#039t work because the ASP variables (lastWeek, etc) are "undefined." Does anyone know of any way the javascript can get access to these variables? Thanks in advance for any help you can provide.

  2. #2
    Rob Guest

    Default RE: ASP/Javascript compatibility problem

    document.reportDialog.selectedDate.value = &#060;%= yesterday %&#062;<BR><BR>see if that works

  3. #3
    Rob Guest

    Default RE: ASP/Javascript compatibility problem

    if that does not work try this<BR><BR>document.reportDialog.selectedDate.val ue = "&#060;%= yesterday %&#062;"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts