需要使用提交表单转换CSS中的HTML表格

时间:2022-11-23 20:27:11

I'm started work with CSS and PHP and I'm trying to convert the old code totally in html and php in a CSS. The graphic ok, its look quite good but I have problem with the submit form, because I have an IF statement in PHP and I tried several thing without solution.

我开始使用CSS和PHP,我试图在CSS中完全转换html和php中的旧代码。图形确定,它看起来相当不错,但我对提交表单有问题,因为我在PHP中有一个IF语句,我尝试了几个没有解决方案的东西。

<div id="DivImg">

<div id="DivFrm">
    <form id="FrmInvioLogin" name="FrmInvioLogin" action="Index.php" method="POST" onsubmit="<? if($Loggatura->Errore == COD002) echo "return ControlloForm();" ?>"  >
        <table  cellpadding="0px" cellspacing="0px" width="80%">
            <tr>
                <td>UserName</td>
                <td><input name="FrmLogin" id="FrmLogin" type="text" size="30" maxlength="30" class="text" /></td>
            </tr>
            <tr>
                <td>Password</td>
                <td><input name="FrmPswd" id="FrmPswd" type="password" size="30" maxlength="30" class="text" /></td>
            </tr>
            <tr><td>&nbsp;</td><td>&nbsp;</td></tr>             
            <?
            # Cambio Password per errore COD002
            if($Loggatura->Errore==COD002) {
                echo "<tr>
                        <td>Nuova Password</td>
                        <td><input name=\"FrmNewPswd\" id=\"FrmNewPswd\" type=\"password\" size=\"30\" maxlength=\"30\" class=\"text\" /></td>
                    </tr>
                    <tr>
                        <td>Ripeti Password</td>
                        <td><input name=\"FrmRptPswd\" id=\"FrmRptPswd\" type=\"password\" size=\"30\" maxlength=\"30\" class=\"text\" /></td>
                    </tr>
            <tr><td>&nbsp;</td><td>&nbsp;</td></tr>                         
                    <tr><td colspan=\"2\"><span class=\"PatCar\">Inserire la password con almeno 8 caratteri. Deve essere pesente almeno un numero ed uno dei seguenti caratteri: $ % & . , ! - _ @</span></td></tr>
                    <tr><td colspan=\"2\"><span class=\"PatCar\">Non si può usare il proprio nominativo o ripetere la password precedente</span></td></tr>";
            }
            ?>

            <tr>
                <td></td>
                <td>
                    <input name="Login" id="Login" type="hidden" value="Invio" />
                    <br /><input type="image" src="Img/BtnLogin.gif" border="0" onclick="document.FrmInvioLogin.submit()" />                    </td>
            </tr>
        </table>
    </form>
</div>

I tried this:

我试过这个:

<div class="container">
    <div class="row">
        <div class="col-sm-6 col-md-4 col-md-offset-4">
            <h1 class="text-center login-title"></h1>
            <div class="account-wall">
                <img class="profile-img" src="Img/" width="150px;" alt="">
                <form class="form-signin" action="Index_new.php" method="post" onsubmit="return ControllaForm()" >
                <input name="FrmLogin" id="FrmLogin" input type="text"  class="form-control" placeholder="UserName" required autofocus>
                <input name="FrmPswd" id="FrmPswd" input type="password" class="form-control" placeholder="Password" required>

                <button class="btn btn-lg btn-primary btn-block" id="FrmInvioLogin" name="FrmInvioLogin" input type="submit" value="Submit">
                    Login</button>

                    </form>
            </div>

        </div>
    </div>
</div> 

The function "controllaForm is defined and with the old code it works. I know there aren't the second div for new password, but meanwhile I would see at least the login works. What's wrong?

函数“controllaForm是定义的,它使用旧代码。我知道新密码没有第二个div,但同时我会看到至少登录有效。有什么问题?

1 个解决方案

#1


0  

k. Fixed.

<div class="container">
    <div class="row">
            <div class="col-sm-6 col-md-4 col-md-offset-4">
                <h1 class="text-center login-title"></h1>
                <div class="account-wall">

                    <form id="FrmInvioLogin" class="form-signin" name="FrmInvioLogin" action="Index_new.php" method="POST" onsubmit="<? if($Loggatura->Errore == COD002) echo "return ControlloForm();" ?>"  >
                    <img class="profile-img" src="Img/" width="150px;" alt="">

                    <input name="FrmLogin" id="FrmLogin" input type="text"  class="form-control" placeholder="UserName" required autofocus>

                    <input name="FrmPswd" id="FrmPswd" input type="password" class="form-control" placeholder="Password" required>


                <?
                # Cambio Password per errore COD002
                if($Loggatura->Errore==COD002) {?>

                        <div style='margin-bottom': 0px> <input name="FrmNewPswd" id="FrmNewPswd" input type="password" class="form-control" placeholder="Nuova Password" required autofocus>

                        <input name="FrmRptPswd" id="FrmRptPswd" input type="password" class="form-control" placeholder="Ripeti Password" required>

                        <h5 class="text-justify">Inserire la password con almeno 8 caratteri. Deve essere pesente almeno un numero ed uno dei seguenti caratteri: $ % & . , ! - _ @     </h1    >
                        <h5 class="text-justify">Non si può usare il proprio nominativo o ripetere la password precedente.</h1  >

                <?php } else { ?>

                        <?php } ?>




                <button class="btn btn-lg btn-primary btn-block" input name="Login" id="Login" name="Login" type="hidden" value="Invio" onclick="document.FrmInvioLogin.submit()" >
                        Login</button>              
                <label class="checkbox pull-left">


                    </label>
                    <a href="#" class="pull-right need-help">  </a><span class="clearfix"></span>


                    </form>
                </div>

            </div>
        </div>
    </div> 

#1


0  

k. Fixed.

<div class="container">
    <div class="row">
            <div class="col-sm-6 col-md-4 col-md-offset-4">
                <h1 class="text-center login-title"></h1>
                <div class="account-wall">

                    <form id="FrmInvioLogin" class="form-signin" name="FrmInvioLogin" action="Index_new.php" method="POST" onsubmit="<? if($Loggatura->Errore == COD002) echo "return ControlloForm();" ?>"  >
                    <img class="profile-img" src="Img/" width="150px;" alt="">

                    <input name="FrmLogin" id="FrmLogin" input type="text"  class="form-control" placeholder="UserName" required autofocus>

                    <input name="FrmPswd" id="FrmPswd" input type="password" class="form-control" placeholder="Password" required>


                <?
                # Cambio Password per errore COD002
                if($Loggatura->Errore==COD002) {?>

                        <div style='margin-bottom': 0px> <input name="FrmNewPswd" id="FrmNewPswd" input type="password" class="form-control" placeholder="Nuova Password" required autofocus>

                        <input name="FrmRptPswd" id="FrmRptPswd" input type="password" class="form-control" placeholder="Ripeti Password" required>

                        <h5 class="text-justify">Inserire la password con almeno 8 caratteri. Deve essere pesente almeno un numero ed uno dei seguenti caratteri: $ % & . , ! - _ @     </h1    >
                        <h5 class="text-justify">Non si può usare il proprio nominativo o ripetere la password precedente.</h1  >

                <?php } else { ?>

                        <?php } ?>




                <button class="btn btn-lg btn-primary btn-block" input name="Login" id="Login" name="Login" type="hidden" value="Invio" onclick="document.FrmInvioLogin.submit()" >
                        Login</button>              
                <label class="checkbox pull-left">


                    </label>
                    <a href="#" class="pull-right need-help">  </a><span class="clearfix"></span>


                    </form>
                </div>

            </div>
        </div>
    </div>