Hi I need some help please,I have hidden field and the value for this, is came from the return of my ajax, example of the returned value from success is A-001…Now how can I make this values not to be view as plain text ?. I don’t know how to encode this in javascript.
You can’t - anyone can view the source of the page and see what it contains. However you ‘encode’ it the encoded value will still be able to be seen (and reused later if they want to).
In that case the exact value would be whatever you output in base64. As the form will be set up to expect that value they will be able to copy and reuse it.
As you are using an Ajax call to retrieve the value from the server you already have the code on the server to generate the value - you just need to call it at the start of the server side form processing.
Hi felgall,I am confuse before I can have the value for my hidden field…I have 2 ajax request first to do before I can have the exact value for my hidden field,this exact value is depending on the first and second request and what is being returned.
If you set it on the server after submitting the form then you don’t need the Ajax requests. All they are doing is getting values from the server. Once the form data is on the server you can get those values directly without Ajax to perform the same calculation…
You would need to do that anyway for the small percentage of users with JavaScript turned off.