New call-to-action
Results 1 to 3 of 3

Thread: Clear contents of field?

  1. #1
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Clear contents of field?

    Hi All,

    I have got this JS code to work to give a pop up message when the fields have got the dates in the wrong order.
    Code:
    var firstdate1 = {grid.object}.getValue('G','FIRST_INTERVIEW',{grid.rowNumber});
    var lastdate2 = {grid.object}.getValue('G','SECOND_INTERVIEW',{grid.rowNumber});
    
    if (lastdate2<firstdate1)
    {
    alert('Last date must be after the first date '+firstdate1);
    //{grid.Object}.setValue('G','SECOND_INTERVIEW',{Grid.RowNumber},'');
    }
    What I would like to do is have the date field cleared out after the user has clicked OK on the message box so they can now enter a valid date.

    Using OnBlur or OnChange goes into a permanent loop.

    All suggestions welcome.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  2. #2
    Member
    Real Name
    David Mildenhall
    Join Date
    Jul 2009
    Location
    Reading, UK
    Posts
    235

    Default Re: Clear contents of field?

    Keith,

    I haven't had a go at this yet but maybe a combination of OnChange and OnBlur.

    In your if condition in OnChange you could skip the condition if the lastdate is blank and then make sure focus remains in lastdate

    With OnBlur you can make sure a value has been entered.

    David.

  3. #3
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: Clear contents of field?

    Hi David,

    Not sure I follow your line of thinking. How would you suggest I do this?
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

Similar Threads

  1. Length of field contents
    By Sandy Garrett in forum Alpha Five Version 8
    Replies: 2
    Last Post: 09-27-2010, 12:17 PM
  2. Why does click on one dropdown clear contents of second dropdown?
    By fsi in forum Application Server Version 9 - Web/Browser Applications
    Replies: 0
    Last Post: 07-26-2009, 09:04 AM
  3. Deleting field contents
    By foodminer in forum Alpha Five Version 6
    Replies: 2
    Last Post: 12-25-2005, 03:01 PM
  4. How to Hide Contents of a Field
    By Britt A Cummins in forum Alpha Five Version 5
    Replies: 3
    Last Post: 12-11-2002, 03:02 PM
  5. Copy field's contents
    By forskare in forum Alpha Five Version 4
    Replies: 21
    Last Post: 09-04-2000, 11:13 AM

Bookmarks

Posting Permissions

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