❓ Help Modify the html code

Status
Not open for further replies.

Alieson09

Forum Guru
modify the html code to show the password
HTML:
<div class="container">
            
                <div class="row">
                    <div class="col-lg-6">
                        <div class="card">                         
                        </div> <!-- .card -->
                    </div><!--/.col-->
                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-header">
                                <strong>Change </strong> Password
                            </div>
                            <div class="card-body card-block">
                                <form method="post" enctype="multipart/form-data" class="user" name="changepassword" onsubmit="return checkpass();">                         
                                   <?php
$adminid=$_SESSION['bpmsaid'];
$ret=mysqli_query($con,"select * from login where ID='$adminid'");
$cnt=1;
while ($row=mysqli_fetch_array($ret)) {
?>
                                    <div class="form-group">
                                        <div class="col col-md-3"><label for="text-input" class=" form-control-label">Current Password</label></div>
                                        <div class="col-12 col-md-9"><input type="password" name="currentpassword" class=" form-control" required= "true" value=""></div>
                                    </div>
                                    <div class="row form-group">
                                        <div class="col col-md-3"><label for="email-input" class=" form-control-label">New Password</label></div>
                                        <div class="col-12 col-md-9"><input type="password" name="newpassword" class="form-control" value="" required="true"></div>
                                    </div>
                                    <div class="row form-group">
                                        <div class="col col-md-3"><label for="password-input" class=" form-control-label">Confirm Password</label></div>
                                        <div class="col-12 col-md-9"> <input type="password" name="confirmpassword" class="form-control" value="" required="true"></div>
                                    </div>                   
                                    <?php } ?>
                                   <p style="text-align: center;"> <button type="submit" class="btn btn-primary btn-sm" name="submit" >Change</button></p>
                                </form>
                            </div>                           
                        </div>                       
                    </div>
                    <div class="col-lg-6">                 
                </div>
            </div>
        </div><!-- .animated -->
    </div><!-- .content -->
 
To modify the HTML code to show the password input fields, you can simply change the input type attribute from "password" to "text" for the "Current Password," "New Password," and "Confirm Password" fields. This will make the passwords visible to the user.

Here's the modified HTML code:

HTML:
<div class="container">
            
                <div class="row">
                    <div class="col-lg-6">
                        <div class="card">                         
                        </div> <!-- .card -->
                    </div><!--/.col-->
                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-header">
                                <strong>Change </strong> Password
                            </div>
                            <div class="card-body card-block">
                                <form method="post" enctype="multipart/form-data" class="user" name="changepassword" onsubmit="return checkpass();">                         
                                   <?php
$adminid=$_SESSION['bpmsaid'];
$ret=mysqli_query($con,"select * from login where ID='$adminid'");
$cnt=1;
while ($row=mysqli_fetch_array($ret)) {
?>
                                    <div class="form-group">
                                        <div class="col col-md-3"><label for="text-input" class=" form-control-label">Current Password</label></div>
                                        <div class="col-12 col-md-9"><input type="text" name="currentpassword" class=" form-control" required= "true" value=""></div>
                                    </div>
                                    <div class="row form-group">
                                        <div class="col col-md-3"><label for="email-input" class=" form-control-label">New Password</label></div>
                                        <div class="col-12 col-md-9"><input type="text" name="newpassword" class="form-control" value="" required="true"></div>
                                    </div>
                                    <div class="row form-group">
                                        <div class="col col-md-3"><label for="password-input" class=" form-control-label">Confirm Password</label></div>
                                        <div class="col-12 col-md-9"> <input type="text" name="confirmpassword" class="form-control" value="" required="true"></div>
                                    </div>                   
                                    <?php } ?>
                                   <p style="text-align: center;"> <button type="submit" class="btn btn-primary btn-sm" name="submit" >Change</button></p>
                                </form>
                            </div>                           
                        </div>                       
                    </div>
                    <div class="col-lg-6">                 
                </div>
            </div>
        </div><!-- .animated -->
    </div><!-- .content -->

Note: Showing passwords can be a security risk, so it's important to consider the implications of doing so. It's generally recommended to keep password fields as "password" type for security purposes.
 
Change the "type" attribute from "password" to "text", so that the code now looks like this:

<input type="text" name="currentpassword" class="form-control" required= "true" value="">
<input type="text" name="newpassword" class="form-control" value="" required="true">
<input type="text" name="confirmpassword" class="form-control" value="" required="true">
 
Status
Not open for further replies.

About this Thread

  • 2
    Replies
  • 405
    Views
  • 2
    Participants
Last reply from:
EMpoPOY ng Pinas

Trending Topics

Online now

Members online
492
Guests online
3,051
Total visitors
3,543

Forum statistics

Threads
2,338,252
Posts
29,302,967
Members
1,126,138
Latest member
kiara13
Back
Top