I had no clue about it - I mean never heard the terms :)
Thank you very much for point to the direction. After some googling, it is
almost working.
Encoding is just fine (using btoa).
When I read it back and want to decode - it's not yet behaving right. I'm
suspecting my javascript is a problem.
There is a bunch of fields which now have encrypted values (class
'EncodedDescriptionField'), and I am trying to use the following to reclaim
the original values:
$(".EncodedDescriptionField").html(atob($(".EncodedDescriptionField").text()));
What am I doing wrong? (It doesn't change the values - they remain as they
are, encrypted)
On Thursday, May 16, 2019 at 5:35:39 PM UTC-4, João Matos wrote:
>
> Have you considered base64 encoding/decoding?
>
> quinta-feira, 16 de Maio de 2019 às 20:43:58 UTC+1, Vlad escreveu:
>>
>> I have the following javascript in the view:
>>
>> var id = $('#CurrentCartId').text();
>> var description = $(this).text();
>> var url='{{=URL('cart','description')}}';
>> url += '/' + id + '/';
>> url += description;
>> ajax(url,[],':eval');
>>
>> the reason I use url+= to pass parameters instead of using args in the
>> URL helper is because the parameters are coming from the html itself - they
>> are not known in the controller py.
>>
>> now the problem is that it changes the description and I have no way to
>> recover its original value. for example, when description is "askjdf d
>> dka;lskdj 3838&^&%$#@ ((alksjdf__ - ))" (just a randomly typed string in
>> this case), it comes out as "askjdf_d___dka_lskdj__3838_____". Obviously,
>> it needs to do this conversion in order to pass the parameter, but I need
>> to be able to recreate the original string, entered by the user.
>>
>> Is there a better way of doing this? I.e. a better way of passing a
>> parameter in a way that it could be "recreated" and stored in the database
>> exactly as typed by the user?
>>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/1c716eaa-886a-4264-b80d-d51e035ecb55%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.