none
Javascript Date Validation in Business Data List WebPart

    Question

  • Hello All,

     

    Do you have any idea on validating Date in Business Data List Web part using either JavaScript or Jquery.

    To be precise February dates(30,31 or 29 in case not a leap year)

     

     

    Thanks,

    -N


    • Modifié Mike Walsh FIN mercredi 15 juin 2011 12:13 Large section of font information removed
    • Déplacé Mike Walsh FIN mercredi 15 juin 2011 12:13 BDC questions go to the BDC forum - not to general (From:SharePoint - General Question and Answers and Discussion (pre-SharePoint 2010))
    mercredi 15 juin 2011 12:01

Toutes les réponses

  • Please clarify your business needs.

    Dmitry

    Lightning Tools LogoLightning Tools Check out our SharePoint tools and web parts
    mercredi 15 juin 2011 14:32
  • I have a Business Data List WebPart which shows 90 days old data based on current data.

    everything is setup correctly, Except two major problems:

    1) User is able to enter date as 02/30/2011 or 02/31/2011 (mm/dd/yyyy format)

    which is logically wrong. I also wish to consider a case of leap year (February month)

    I know it can be handled in sql query, but i wish handle it using Jquery or javascript

    2) Also every early year(ie. Jan or Feb Month) the data appears incorrect as it shows 90 days old data based on current date.

    Hope this information is enough to understand the issue.

     

    mercredi 15 juin 2011 15:14
  • can anybody give me some inputs?

    I know this can be achieved as javascript already exists in this webpart("add" linkbutton next to "Search string" textbox)

    Any hint is highly appreciated.

     

    Thanks,

    -N

     

    mardi 21 juin 2011 09:44
  • Hello!

    I can only suggest taking a look at ViewSource of the rendered Page with your web-part and find what Html-elements are parts of the Business Field you want to validate. Find input-tag which contains the date inserted by user and div-tag which is used to display date. You need to get their id(s). Add to the web-part  code to add startup client script to the page. This code will hook up on textchanged-event (or blur-event) of the input-tag. An event handler will validate the current value and show message if date isn't correct. Also you probably need to add some client code before the form sent data to the server, I remember (if I'm not wrong at all) only that this can be achieved by built-in means of ASP.NET.


    .Net Follower (http://dotnetfollower.com)
    samedi 8 octobre 2011 02:28