Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

176
Vistas
filling fields of a form using mssql db and connecting between them

I have two select fields in html form and i would like to set my options according to a table in my mssql database

I have created a connection using SQLAlchemy:

Server='MYLAPTOP'
Database="master"
Driver='ODBC Driver 17 for SQL Server'
Database_Con=f'mssql://@{Server}/{Database}?driver={Driver}'

engine = create_engine(Database_Con)
con = engine.connect()

and this is my html form :

<form method=post enctype=multipart/form-data>
Choose primary subject:
<select id="primary" name="primary" 
</select>
<hr />
Choose secondary subject:
<select id="secondary" name="secondary"></select>
<hr />
<div class="mb-3">
  <input type=File name=File>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>

and this is how I get the table:

df = pd.read_sql_query("select * from Data_Tables",con)
    print(df)

my table:

        Name    Primary Secondary
1         A          B         C
2         D          B         E
3         X          D         V
4         F          G         N
5         L          G         V

I want that in "primary" select field the options will be :B,D,G and according to the first selection in "primary" field the options will change if i choose B the options will be E,C if I choose G then N,V will appear and for D it will be V

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda