NerishaB
Posts: 25
|
| Posted: 10/04/2010, 4:40 AM |
|
I am creating a page that passes a key, that I used to ecrypt a key passed to that page. I want to display the decrypted key in a textbox. Now, I have the function created to perform the decryption, I just dont know how to display the result in a textbox. Am new to this.
See my code:
Function SwapLetters($Key)
{
$j = round(strlen($InputString) / 2) + 1;
$LeftString = Left($InputString, j -1);
$RightString = Substr($InputString, StrLen($LeftString));
$result = '';
For ($i = 0; i<StrLen($InputString); $i++) {
$result = $result . SubStr($LeftString, i, 1) . SubStr($RightString, i, 1);
}
}
And I am trying to place it in $TextBox3 = SwapLetters($KeyString);
|
 |
 |
ckroon
Posts: 869
|
| Posted: 10/04/2010, 5:55 AM |
|
You have SwapLetters($KeyString);
perhaps you meant SwapLetters($Key);
If thats not it... then I would do something like this:
$change = SwapLetters($KeyString);
$Component->TextBox3->SetValue($change);
_________________
Walter Kempees...you are dearly missed. |
 |
 |
datadoit
|
| Posted: 10/04/2010, 6:00 AM |
|
You have to CodeChargisize it:
For your textbox component, in it's BeforeShow event, choose Add Action
and choose Call Function. Then put in SwapLetters($KeyString).
If $KeyString is in the URL, you can enter
SwapLetters(CCGetParam("theURLkey","")).
Make sure the function SwapLetters() is at the bottom of your
_events.php file before the closing ?> tag.
|
|
|
 |
NerishaB
Posts: 25
|
| Posted: 10/04/2010, 6:07 AM |
|
I don't think it is working. The interesting thing is, if it just typed in $TextBox1->SetValue("1");
I still don't get anything displayed. What am I doing wrong? What do I need to do to populate a textbox?
|
 |
 |
NerishaB
Posts: 25
|
| Posted: 10/04/2010, 6:53 AM |
|
I have tried that, but still get no result. Even if I just put in : $textbox3 = "abcde";
I still get not result.
|
 |
 |
datadoit
|
| Posted: 10/04/2010, 9:16 AM |
|
Go through the tutorials: http://support.codecharge.com/tutorials.asp
|
|
|
 |
|