I have a drop-down menu, with 2 options:
New customer and New product.
What I'm looking for is that having selected a certain option takes me to a different form, in case I select "New Product" that takes me to a form where I add this information.
The problem is that I do not remember the code with which this was done ...
Menu code:
<form name="form1" method="post" onSubmit="return validar();">
<p>
<label for="select"></label>
<select name="menu" id="menu">
<option value="nc">Nuevo Cliente</option>
<option value="np">Nuevo Producto</option>
</select>
<input type ="submit" value ="Registrar" />
</form>
Valid which option is selected with javascript, but I do not remember how to start another form depending on the selected option.
<script>
function validar(valor) {
if (menu.value == "nc") {
// Quiero saber el código para cambiar de formulario
// en caso de que seleccione esta opción
}
if (menu.value == "np") {
// Quiero saber el código para cambiar de formulario
// en caso de que seleccione esta opción
}
}
</script>