Quantcast
Channel: Adobe Community : Discussion List - LiveCycle Forms
Viewing all articles
Browse latest Browse all 1160

Writing text in upper case.

$
0
0

Form is developed in LiveCycle 9. Field is used to input text in lower case. It is necessary that during text input ("change" event)in the first letters of the words appear in uppercase. Written the following code:

            <eventactivity="change" name="event__change">

               <scriptcontentType="application/x-javascript">

if (xfa.event.newText.length &gt; xfa.event.prevText.length &amp;&amp; xfa.event.change.length ==1)

{

  1. xfa.event.change = xfa.form.topmostSubform.variables.Validation.VerchReg(xfa.event.chang e);

}

else

{

  1. xfa.event.change = "";

}

</script>

            </event>

 

 

  <variables>

         <scriptcontentType="application/x-javascript" name="Validation">

var first=true;

function VerchReg(newsymbol)

{

varre = /[А-Яа-я-" "]/;//Вводятся только кириллица - и пробел

if (re.test(newsymbol))

{

if (newsymbol==" ")

{

  first=true;

  return newsymbol;

}

if (first)

{

first=false;

return newsymbol.toUpperCase();

}

else

{

return newsymbol;

}

}

else

{

return "";

}

}

}

</script>

         <?templateDesigner expand 1?></variables>

 

Problem: when the form is first opened when entering text in lower case (for example: Voronezh, Vologda, Russia, Moscow, all works well and get the result of the Vologda Voronezh Moscow), however, if the erase all printed, and begin again to enter in lower case Voronezh, Vologda, Russia Moscow, I get the result of the vologda Voronezh Moscow, that is, the first word appear in lowercase. If you delete all printed and before you enter new words in the box to put a space, then delete it and start immediately re-enter text all works as it should, that is the result Voronezh, Vologda and Moscow. Can someone tell me what the problem is.

 

 



Viewing all articles
Browse latest Browse all 1160

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>