I have some characters that are causing my parser problems - so while i sort that out i want to use a substitute as you go approach to weed them out
the keystrokes are < > & and '
am i able to modify this code:
xfa.event.change
= xfa.event.change.replace(/'/g,"´");
to work against all of those at one time --
so something on the change event that would work like this:
if new character is "<" then substitute "("
if new character is ">" then substitute ")"
if new character is "&" then substitute " and "
new character is " ' " then substitute the accent key " ´ "
--- oh and can someone please tell me where I find/access the above accent on the keyboard/within livecycycle too ?
im working on the parser but need to go this way for now.......
any ideas appreciated - cheers
Solved! Go to Solution.
Views
Replies
Total Likes
You have to define a regualar expression for those characters you want exclude or replace while typing.
if (xfa.event.newText.match(/[<]/))
{
xfa.event.change = "(";
}
if (xfa.event.newText.match(/[>]/))
{
xfa.event.change = ")";
}
if (xfa.event.newText.match(/[&]/))
{
xfa.event.change = " and ";
}
if (xfa.event.newText.match(/[']/))
{
xfa.event.change = "´";
}
Views
Replies
Total Likes
Hi,
you can change the users input with some JavaScript in the change:Event.
See here
Views
Replies
Total Likes
Thanks Radzmar
Im familiar with the change event to modify one character stroke at a time
---I'm just not sure how to put the javascript together to deal with the
multiple characters i need to "weed out" at the same time:
do you have a similar code fragment i could have a look at perhaps?
thanks
Views
Replies
Total Likes
You have to define a regualar expression for those characters you want exclude or replace while typing.
if (xfa.event.newText.match(/[<]/))
{
xfa.event.change = "(";
}
if (xfa.event.newText.match(/[>]/))
{
xfa.event.change = ")";
}
if (xfa.event.newText.match(/[&]/))
{
xfa.event.change = " and ";
}
if (xfa.event.newText.match(/[']/))
{
xfa.event.change = "´";
}
Views
Replies
Total Likes
Thank you - thats very helpful.
Appreciated.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies