I have a variable that i will pass from my controller to my view, lets call this variable $validate. This variable will help us to know in what state is the user in (Update or Save).
I will ask user to input an ID and Password in Save state (input text id = enable, password = visible)
But in Update state, i dont want user to update their ID and they cant see their Password (input text id = disable, password = invisible).
Now for the input text id, i could do something like this :
<input type="text" name="ID_user" class="text"
<?php if($validate!='add'){echo "disabled";} ?>
So no javascript are needed in the input text ID
My Question are :
-
How to make the input text password invisible according to
$validatevalue? -
Can i use the same way like input text ID?(so no javascript are needed)
Thanks 😀
Note : i use the same form for Update and Save 😀
Something like this – just use a simple ‘if’ switch statement
edit: I’m assuming you are NOT wanting to ‘POST’ the password back to yourself when it is an update.