get value from select option jsp
I need to take the value of html select tag, I'm trying this code but it
does not work, any ideas?
<body>
<h1>Nuevo Producto</h1>
<form name ='formulario' action='nuevoProducto.jsp' method='post' >
Descripcion<input name='descripcion' type='text' size='20' required><br>
Precio<input name='precio' type='text' size='20' required><br>
Stock<input name='stock' type='text' size='20' required><br>
Categoria <select name="categoid" id="categoid">
<% for(int i=0;i<myList.size();i++){%>
<option value ="<%= myList.get(i).getId() %>" >
<%out.print(myList.get(i).getDescripcion());%></option>
<%}%>
</select><br>
Imagen<input name="imagen" text="seleccionar archivo" type="file"
size="10" accept="image/jpg" /><br>
<input type ="submit" value ='Guardar' />
<!-- <input type="submit" value="guardar">-->
</form>
No comments:
Post a Comment