How to prevent user to enter data in "Date/Time Field"?

Hi folks,
     Back after long time to the forums, where I get answers which are helpful in making me good at utilizing designer.
     I am trying to validate the "Date/Time Field" using JavaScript but couldn't get a proper RegEx expression for various invalid user input formats. If anyone can help me out in finding a proper script that would Great.
     My script grown bigger and bigger to accepting invalid dates, but felt like hardcoding. So, instead I decided why can't we prevent a user to enter data into "Date/Time Field" and use only calendar dropdown. Is there is a way to do this?
find my sample testing docment
https://acrobat.com/#d=mYXkrhO2txuEesCfmvxNXg
Thanks in Advance,
Rajesh

Hi Rajesh,
I don't think there is a way of stopping the user from using the keyboard to enter a date.  You can use the following script in the change event to stop them typing a date but they will still be able to paste a date in.
if (xfa.event.change.length === 1)
xfa.event.change = "";
This code works because if the date is selected from the calendar dropdown then the date xfa.event.change value will be the whole date and therefore longer than one character.
I couldn't access your sample but if you were to set an display picture for the date field to something other than date{YYYY-MM-DD} then a valid date will have a formattedValue that is different than the rawValue.
Dave

Similar Messages

  • How to prevent user from entering zero hours in Timecard

    We have a need to prevent user to enter/submit zero hours in timecard. The case right now is user will be able to enter:
    Hours Type M T W T F
    Vacation 0 8 0 0 0'
    and when we run BEE transfer process it created absences with zero hour duration for Monday, Wednesday, Thursday and Friday.
    We try to prevent absences to be created with zero hours or user to be able to enter zero hours in timecard.
    Please help.
    Thanks

    Hi
    you can refer following example
    ========= formula ===============
    Initialise Variables which can be null
    default for db_pre_period_start is ' '
    default for db_pre_period_end is ' '
    default for db_post_period_start is ' '
    default for db_post_period_end is ' '
    default for db_ref_period_start is ' '
    default for db_ref_period_end is ' '
    READ IN INPUT VARIABLES
    INPUTS ARE resource_id (number)
    , submission_date (text)
    , period (number)
    , period_maximum (number)
    , reference_period (number)
    , db_pre_period_start (text)
    , db_pre_period_end (text)
    , db_post_period_start (text)
    , db_post_period_end (text)
    , db_ref_period_start (text)
    , db_ref_period_end (text)
    , duration_in_days (number)
    , timecard_hrs (number)
    Processing
    l_return = otl_24_hours_check()
    IF l_return > 0 THEN
         ( rule_status = 'E'
         message1 = 'DAILY_MAX_LIMIT' )
    RETURN VARIABLE
    RETURN rule_status, message1
    ============= database package ==============
    FUNCTION otl_24_hours_check
    RETURN NUMBER IS
    j NUMBER := 0;
    e_count NUMBER := 0;
    tc_blocks Hxc_Self_Service_Time_Deposit.timecard_info;
    BEGIN
    tc_blocks := Hxc_Self_Service_Time_Deposit.get_building_blocks;
    j := tc_blocks.FIRST;
    WHILE j IS NOT NULL
    LOOP
    BEGIN
    IF tc_blocks(j).scope = 'DETAIL' THEN
    IF to_number(tc_blocks(j).measure) > 24 then
    e_count := e_count + 1;
    END IF;
    END IF;
    j := tc_blocks.NEXT(j);
    END;
    END LOOP;
    RETURN e_count;
    END;
    ================================
    above formula checks if a person entered more than 24 hours in a day

  • How to prevent users from entering '+' or '0' in front of country code in the phone number field?

    Requirement:
    How can I prevent guest users from entering '+' sign or '0' in front of country-code in the visitor phone number field during self registration?
    Few SMS service providers are not looking for '+' sign or '0' or '00' in front of the international phone numbers to trigger the sms. Providing these values in front of country code during self-registration may fail to deliver the sms to recipient.
    Solution:
    Using a simple regular expression, you can validate the entered phone number during the guest registration. 
    The below regular expression will help you to validate the phone number and allows to register only  when the phone number is not staring with '+' or '0'. 
    ^[1-9][0-9](\d{7}|\d{8}|\d{9}|\d{10}|\d{11}|\d{12})$
    It also performs the below validations.
    only numbers are allowed.
    first digit of the entered phone number should be 1 to 9, so '+' or '0' is not allowed. 
    numbers from 0 to 9 are allowed from the second digit.
    also validates phone number length, the length of the phone number should be 9 to 14.
    Configuration:
    To add the above regex in the visitor_phone number filed, please navigate to ClearPass Guest >> Configuration >> (Pages)Guest Self-Registration >> select the self-registration page and go to Edit >> Register Page >> Form >>  select the filed visitor_phone and set the Validator to " ISRegexMatch" and enter the above regex in the Validator Argument filed as shown below.
    Note:  Edit the Validation Error as per your requirement.
    Verification
    Adding the given regex will validate the phone number and prevent the guest user from registering the phone number starts with '+' or '0'.
    Please find below the sample outputs for your reference.
    Result when phone number starts with '+' or '0'.
    Successful registration.

    Is this a Mac Preview issue?

  • How to prevent user from inputting in a Date field?

    Hi, everyone
    I have another small problems, for a Date field, user can choose from a date window or input from keyboard, is there any way to forbid user to input?
    I want to make the date field behave like a Drop-down list. User can just choose from list, can not input. is it possible?
    Thanks

    What is the objective of disabling date entry? Are you concerned about the date format?
    Steve

  • How can we prevent a user from entering a value in Parameter Field?

    how can we prevent a user from entering a value in Parameter Field and Select-options Field?

    make it invisible, make it inactive, make it display only.
    if the field is not there or not to be seen the user WILL have problems inputting data.
    BUT once the field is there you can NOT prevent that the user fills it with data.
    all you can do is on PAI check if the data the user inputted was good or bad, and clear his inputs, but you can NOT prevent him inputting something.

  • How to force user to enter supplier/customer name in captial letters in R12

    Dear all,
    Could anyone pls advise how to force user to enter supplier/customer name in captial letters in R12? Can I do it using OA framework personalization?
    HY

    Pl post exact versions of OS and EBS.
    The ability to do this exists in forms (professional user interface) using forms personalization, but does not exist in the OAF (self-service) interface, AFAIK. See related MOS Doc 399892.1 (Is It Possible To Restrict Employee Name Entry To All Upper Case in the PUI And SSHR ?) for some details.
    Pl confirm by opening an SR with Support.
    HTH
    Srini

  • How to prevent users from creating new folders in share folder directory?

    Hello guys
    I'd like to know How to prevent users from creating new folders in share folder directory but still keep their power of creating new folders in their personal 'my folder'?
    I tried changing the 'manage privilage ---- create folder' to deny certain user accounts, but by doing so, it also stops the user from creating new folders in their 'my folder', which is not good..
    I also tried going into these share folders and tried different access types such as 'change/delete', 'read', 'traverse folder' etc, but none of it work ideally. The 'change/delete' access still allows them to create new folders, 'read' access prevents creating new folders but also take away their power of saving reports..
    Any thoughts on how to take away their ability to ONLY create new folders in share folder areas without affecting their other privileges?
    Please advise
    Thank you

    Easy, on the shared folders root folder only give them 'read' or 'traverse folder' but on the the folder inside the shared folders root folder give them 'change/delete'. That means they can change anything inside those folders but not create any folders at the shared folders root level.

  • How to prevent user keyin wrong in master-detail

    How to prevent user keyin wrong in master-detail.
    Example : User click button to created mster with out crete detail then they going to another master record for created detail for that master,
    How to control user keyin master-detail currect record finish first then can go to another master?
    Is it posible if I will disable another record of master and enable only current record after they finish to keyin master and detail of this record then I enable all.
    If posible can you give me step-by-step and coding.
    Thank you very much

    I'm not able to understand the scenario. You probably will have to provide more detail of the issue.
    --Shiv                                                                                                                                                                                                                           

  • Do u know how to prompt user to enter password and validate the password?

    hi all,anyone knows how to prompt user to enter password and validate the password as well?I do not need the GUI.Can someone post the codes here?Thanks!

    hi all,anyone knows how to prompt user to enter
    password and validate the password as well?I do not
    need the GUI.Can someone post the codes here?Thanks!Codes are
    BufferedReader
    System.in
    if
    else
    System.out.

  • How to force users to enter their ID and password ?

    I am considering installing AirPort Extreme at our office. We don't want guests connecting to our network. is there any option/software that will force the guest to enter an ID and password to connect to our network ? This is similar to what happens at the hotels when we try to connect to hotel's network.

    How to force users to enter their ID and password?
    is there any option/software that will force the guest to enter an ID and password to connect to our network ? This is similar to what happens at the hotels when we try to connect to hotel's network.
    The AirPort Extreme does not have the features necessary to create a "splash page" that provides basic information about the company and asks users for their identity and password....like you see at most hotels.
    Basically, with an AirPort Extreme, users would have to scan to look for the name of the wireless network to join, and then enter the password to connect.
    The best that you might be able to achieve with the AirPort Extreme is create a "hidden" network, which would require that users know both the name of the wireless network and password to connect.  However, based on experience, this might be more of a hassle than anything else.
    The bottom line.....Apple really designed the AirPort routers for home use, so that might be the best place for them in most cases.

  • How to prevent user or group to use 3-tier WebI and DeskI in XI 3.1

    How to prevent user or group to use 3-tier WebI and DeskI in XI 3.1
    This function is enable in BOE 6.5 by using Supervisor.

    Hi,
    You can explicitly deny access to these applications from the CMC in BOE 3.1. Open the CMC, click on BusinessObjects Enterprise Application and then select the WebI.
    From the right hand side click on the 'Net Access' section for that group and disable the 'Log on to Web-Intelligence and view this object in CMC.'
    This will prevent the option of the WebI for that group.
    I hope this helps you.
    Regards,
    Prashant

  • I lost my Iphone 5 today in Johor Bahru. Not install Find my Phone/Icloud/Offline. How to prevent others access my email and data ? Or how to remote lost mode/locking phone ?

    I lost my Iphone 5 today in Johor Bahru. Not install Find my Phone/Icloud/Offline. How to prevent others access my email and data ? Or how to remote lost mode/locking phone ?

    suyantosdf wrote:
    I lost my Iphone 5 today in Johor Bahru. Not install Find my Phone/Icloud/Offline. How to prevent others access my email and data ? Or how to remote lost mode/locking phone ?
    If you didn't enable find my iphone in icloud settings on your phone, then you can't do a lost mode or lock your phone.
    I would assume you had a passcode on your phone to lock it.  If you didn't then start changing your passwords.
    Report the lost to your phone carrier - local authorities.

  • Prevent user from deleting someone else data

    I have a table
    create table T(
    infoID number primary key,
    info varchar2(4000),
    user varchar2(1)
    and users a,b,c with object priveleges on table T.
    What is the best way to prevent user from deleting someone else data?
    1. Create a view for each user to interacat with ( where user='a') and revoke privileges from table T.
    2. Use procedures or trigers to catch a bad user.
    3. ?

    Leo is certainly correct that VPD will solve the issue you have described. however another option also exists without the need to create a separate view for each user (as you described) or the use of VPD, the option would be to do something like the following.
    create user ownera identified by ownera;
    create user usera identified by usera;
    create user userb identified by userb;
    create user userc identified by userc;
    grant connect, resource to ownera;
    grant create view to ownera;
    grant connect to usera, userb, userc;
    conn ownera/ownera
    create table mytable ( id number primary key,
    userid varchar2(8) not null, mod_date date not null, text varchar2 (100));
    create sequence mytable_seq;
    create or replace trigger biu_mytable_trg
    before insert or update on mytable
    for each row
    begin
         select mytable_seq.nextval into :new.id from dual;
         :new.userid := user;
         :new.mod_date := sysdate;
    end;
    create or replace view v_mytable as
    select * from mytable where userid=user;
    grant select, insert, update, delete on v_mytable to usera, userb, userc;
    try inserting and selecting as the various userX users.
    Good luck.

  • How to prevent a user from entering characters into a number field

    How do you prevent a user from entering characters like A or B into a field that is defined as a numeric field?
    Please note that
    - we use block validation (for other reasons)
    - we are not able to convert these numeric fields to character fields
    We want to avoid a user being hasseled with the FRM-40209 ... message.
    This message is
    - not very helpfull because it does not inform us what the problem field is
    - not suppressable
    Any hints ?

    I went back to the drawing board on this one.
    You are absolutely right : the message can be catched !
    By writing an on-error trigger you can check for the error number. Sadly enough my first attempt on this used the on-message trigger which never fired hence my desperation.
    Anyway, the on-error trigger in combination with :SYSTEM.CURRENT_ITEM or :SYSTEM.TRIGGER_ITEM enables me to display a more meaningfull message to my users.
    Thanks for the hint.

  • How to Restrict user to enter the data in CAPS ONLY

    Hi,
    I have textinput in my page,i have to restrict the user to enter the data caps only.
    can any one help me on this.
    Karthik

    Hi,
    h1.
    I have textinput in my page,i have to restrict the user to enter the data caps only.
    -------u need to set the CSS class for this item
    Regards
    Meher Irk
    Edited by: Meher Irk on Oct 24, 2010 11:16 AM

Maybe you are looking for