Enable Inputs According to a select - PHP- SQL SERVER

0

Cordial Greeting,

I hope you are well and can help me with what I want to do:

  • I have a Select, loaded from a database:

    include'conexion.php ';

                $sql = "EXEC SP_COMBO_PAGADURIAS";
                $stmt = sqlsrv_prepare($conn, $sql);
                if(sqlsrv_execute($stmt)){
                $menu="<select name='menu' onchange='getComboC(this)' class='form-control' id ='menu'>\n<option selected>Seleccionar:</option>";
                while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC)){
                $menu.="\n<option value='".$row['Campo1']."'>".utf8_encode($row['Nombre'])."</option>";
                }
                $menu.="\n</select>";
                echo $menu;
                }
    
  • Suppose what you loaded was:

      <select> <option>Todos</option> <option>Prueba</option>
        <option>No</option> </select>
    
  • Assuming that test is a data from the database in the TBL_PAGADURIAS table, what I want to do is that when selecting "test" of the select, certain inputs are enabled according to BD fields.
  • Test has in the BD: Field1, Field2, Field3, Field4, Field5 Field1 = YES Field2 = NO Field3 = YES Etc ...

    Then I have 5 inputs

    <input type="text" disabled>
    <input type="text" disabled>
    <input type="text" disabled>
    <input type="text" disabled>
    <input type="text" disabled>
    
  • Then, if you selected the test of the loaded loaded DB, I want you to enable each input, if the field you have registered in the database is YES.
  • asked by Andres Rodriguez 23.10.2018 в 18:38
    source

    0 answers