swap string characters? - InfoPath Dev
in

InfoPath Dev

swap string characters?

Last post 04-15-2013 07:46 AM by HHearle. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 04-10-2013 06:22 AM

    swap string characters?

    Hi, I'm using InfoPath 2003 (company hasn't bothered to upgrade yet :( ) and I'm experimenting with ways to encrypt passwords typed out on a form.  I want to be able to write a JavaScript code that will scramble the letters filled out in a text box when a user clicks a button.  I'm pretty new to writing code, my only experience being SendKeys and a few website codes to disable right-clicks, but I was thinking in principal it would maybe be something like

     if character = "a"

    return "b"

    or something like that- I know that that's not right but that is the sort of thing I am trying to achieve.  Any help much appreciated.

  • 04-13-2013 08:46 AM In reply to

    Re: swap string characters?

     What about just using the translate function for this? Of course - if you do that and someone opens the form template, they will be able to see the formula and break the "code" such as it is. But they can also save the form as source files and read your .js file at that rate - so using js for this is only slightly better. Can you use managed code? That is, do you have Visual Studio? Then you could use some actual encryption.

    Hilary Stoupa

  • 04-15-2013 12:22 AM In reply to

    Re: swap string characters?

    Hi Hilary,

    Well trouble is I don't have Visual Studio at work- the administrators worry about the security of it....

     I'm pretty new to code, could you explain how to use the translate function?  I'm using Microsoft Script Editor 7

  • 04-15-2013 07:38 AM In reply to

    Re: swap string characters?

     The translate function is a built in InfoPath function. No code / script needed - you could use a rule for this.

    Hilary Stoupa

  • 04-15-2013 07:46 AM In reply to

    Re: swap string characters?

    Ah- found it! Just what I was looking for, thanks!  Sorry about that, like I said pretty new to all of this but thank you so much!

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.