Our Engineers can Write as well
If you ever come across the issue of restricting user entry of multiple spacing in the text field while using Adobe PDF forms, save this blog, as this is handy in explaining how to quickly and effectively solve your issue.
Our technical explanation has the below sections for your easy understanding:
a) A possible scenario
b) The solution
A possible scenario:
Here is a visual representation of how user entry of multiple spaces in a text field can affect the data quality.
The solution with a little description:
We manage to solve this problem by using the Custom Keystroke Script while creating the editable form.
For the keystroke one needs to check the following:
event.selStart – Property tells the starting position of the current text selection during a keystroke event.
event.rc – Indicates whether a particular event in the event chain should succeed. Set to false to prevent a change from occurring or a value from committing. The default is true.
// Custom Keystroke for text field
// event.selStart is to check the index of the character string
// event.change is to check the value of the up-coming change in field
//event.rc enables the changes in the text field
if((event.selStart == ” ” ||
event.value[event.selStart-1] == ” ” || event.value[event.selStart] == ” ” )&&
event.change ==” “)
event.rc = false;
We trust that this blog comes to your help when you are trying to restrict multiple spacing in Adobe PDF editable forms.
For similar useful tips, keep checking this space.