How to show a different value from an input that what will be received as php

0 votes
I'd like to know if there is a way to show in an input of type text a different value than the one send to PHP.

For example, let say you have :

<input type="text" value="John"> that display John.

Can I change the value to "Niraj" for the user but keep it to "Dey" for php?

Can I achieve this using the difference between $.attr('value') and $.val()?

I ran a couple of tests and it seems that I will have to reverse it directly in my controller. Is there an other solution?
Jul 8, 2020 in Java-Script by kartik
• 37,510 points
10,528 views

1 answer to this question.