salve ragazzi, premetto che sono un junior e sto imparando. Non ho trovato tutorial al riguardo e quindi posto.
Problema: creare un menù a tendina "select" collegato ad una tabella del db.
Utilizzo: ho uno script per le news con i parametri "titolo" e "testo" vorrei aggiungere un parametro "categoria news".
Quindi ho creato la mia bella tabellina "category" con i parametri id e categoria dentro.
Ho inserito manualmente le categorie ed ora vorrei attribuirle ad ogni singola news.
Ciò che ho pensato è questo:
<select name="selcat" onchange="document.getElementById('news').azione.v alue='cat';document.getElementById('news').idcat.v alue='';
document.getElementById('news').idstep.value='';
document.getElementById('news').nomecat.value='';d ocument.getElementById('news').submit();">
<option value="0"></option>
</select>
Ho un file "hide" con le funzioni e questo è il form:
<form name="news" id="news" action="./news_hide.php" method="post" target="hide">
![]()