Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Problem Reagrding DateComparison

Problem Reagrding DateComparison

Scheduled Pinned Locked Moved ASP.NET
helpjavascriptcss
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    ballameharmurali
    wrote on last edited by
    #1

    Hello everyone, I have a small doubt regarding DateComparsion.I have a two textboxe's and an image button.When i enter the two dates i want to check that txtstartdate should be less than txtenddate using javascript when the imagebutton is clicked,name those two textboxes id as txtstartdate and txtendate.Plz anybody help me in writing this code. ThankX in advance, Murali Murali

    J 1 Reply Last reply
    0
    • B ballameharmurali

      Hello everyone, I have a small doubt regarding DateComparsion.I have a two textboxe's and an image button.When i enter the two dates i want to check that txtstartdate should be less than txtenddate using javascript when the imagebutton is clicked,name those two textboxes id as txtstartdate and txtendate.Plz anybody help me in writing this code. ThankX in advance, Murali Murali

      J Offline
      J Offline
      John ph
      wrote on last edited by
      #2

      hope this will help you function DateComparison(){ var startDate; var endDate; startDate = document.formName.txtStartDate.value; endDate = document.formName.txtEndDate.value; var stYear, enYear, stMonth, enMonth, stDay, enDay; stYear = startDate.substring(6,10); enYear = endDate.substring(6,10); stMonth = startDate.substring(3,5); enMonth = endDate.substring(3,5); stDay = startDate.substring(0,2); enDay = endDate.substring(0,2); if (stYear > enYear) { return false; } else if (stYear == enYear) { if (stMonth > enMonth) { return false; } else if (stMonth == enMonth) { if (stDay > enDay) { return false; } } } return true; } Regards John

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups