cancel
Showing results for 
Search instead for 
Did you mean: 

Restricting User Editing Date Picker Field Manually In Adobe Form

ssatheesh
Explorer
0 Kudos

Hi Experts,

                   I have an Date Picker field, which list down the calender to select date. But, along with that, it allows user to input any data manually. I want the user to select the date only from the calender and the user should not be allowed to edit the field manually. As option to do that ? I tried all available types and nothing seems to be fulfilling my requirement.





Regards,

Satheeshkumar.M

Accepted Solutions (1)

Accepted Solutions (1)

SandySingh
Active Contributor
0 Kudos

Hi satheesh

This is possible with a script in the EXIT event of the date field.

It uses a regular expression to check the entered value for a specific pattern.

Allows are dates in these way: [9|99] [.|/|-] [9|99] [.|/|-] [99|9999].

Javascript code

if (! this.formattedValue.match(/^\d{1,2}[\.\/\-]\d{1,2}[\.\/\-](\d{4}|\d{2})$/g)) { 

          xfa.host.messageBox("Enter a correct date!", "Invalid Date", 0, 0); 

         xfa.host.setFocus(this.somExpression); 

}

regards

Sandy

ssatheesh
Explorer
0 Kudos

Dear Sandy,

                    Thanks for your immediate response. Its working fine and popup message also good  but, still Date picker is editable. My requirement is do not allow enter any value on that field. User only select the date through calender.

Regards,

Satheeshkumar M

SandySingh
Active Contributor
0 Kudos

Hi Satheesh,

Use the  following script in the "change event" of the date field. It will alert the user and prevent keyboard inputs:



if (xfa.event.newText.length == 1) { 

          xfa.host.beep("3");

           xfa.host.messageBox("Select the date from dropdown!", "Input not possible", 0, 0);

          xfa.event.change = "";  

Hope it helps. let me know the results
Regards
Sandy

ssatheesh
Explorer
0 Kudos

Dear Sandy,

               Thank you very much for your reply, This is exact solution for my requirement. Please guide me to learn more javascript for Adobe interactive form otherwise suggest any link.

Answers (1)

Answers (1)

ssatheesh
Explorer
0 Kudos

Dear sandy,

Adobe interactive form after downloading through ABAP coding, i have to edit the (pdf) adobe form.

I would like to save a form to the same location but there seems to be no way to set a default folder. Its popup save as dialog box asking when i was save the first time. Please give me the solution to close this issues.

Regards,

Satheeshkumar.M

SandySingh
Active Contributor
0 Kudos

Hi Satheesh

Refer to links below to achieve this via ABAP code or via Script.

Close the thread with correct and helpful answers.